home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d883.lha / BBBBS / BBBBS59.lha / rexx / bbsLOCAL.rexx < prev    next >
OS/2 REXX Batch file  |  1993-06-12  |  152KB  |  5,467 lines

  1. /* $VER: bbsLOCAL.rexx 5.9 © 1993 Richard Lee Stockton 8:36PM (12.6.93)
  2.         - FREELY DISTRIBUTABLE AS LONG AS THIS NOTICE REMAINS -
  3.  
  4.                 BBBBS.baud without the BaudBandit stuff
  5.        Will multi-task with BBBBS.baud (within limits, see docs)
  6.  
  7.      THIS IS THE SYSOP'S VERSION OF BBBBS.baud FOR LOCAL USE ONLY!
  8. */
  9.  
  10. copyright.=''
  11. copyright.1=STRIP(SUBSTR(SOURCELINE(1),10))
  12. copyright.2='
  13. from Gramma Software 17730-15th NE Suite 223 Seattle WA 98155'
  14. copyright.3='
  15. ARexx portions of this software copyright 1990-93 Richard Lee Stockton'
  16. copyright.4='- FREELY DISTRIBUTABLE as long as this notice remains -'
  17.  
  18. /* If the QuickSortPort not found then try to run setup.rexx */
  19.  
  20. IF ~show('P','QuickSortPort') THEN CALL setup.rexx()
  21. IF ~show('P','QuickSortPort') THEN EXIT
  22.  
  23. IF SHOW('P','BBBBS_LOCAL') THEN
  24.   DO
  25.     SAY 'bbsLOCAL.rexx is already running!'
  26.     EXIT 0
  27.   END
  28. IF SHOW('P','BBBBS') & GETCLIP('BBS_maint')~='' THEN
  29.   DO
  30.     SAY 'BBS_maint flag is set. Wait until processing is finished, then restart.'
  31.     EXIT 0
  32.   END
  33. CALL SETCLIP('BBS_mainfiles')
  34. CALL SETCLIP('BBS_mainusers')
  35. CALL OPENPORT('BBBBS_LOCAL')
  36.  
  37. PARSE VERSION . . cpu .
  38. cpu=RIGHT(cpu,2)/10
  39. IF cpu<1 THEN cpu=1
  40.  
  41. /* BBS Directories (may be created with SETUP option) */
  42. bbs.=''
  43. bbs.1='Information' /* text files from sysop for the user to read */
  44. bbs.6='Scratch'
  45. bbs.7='BBS_HELP'
  46. bbs.8='rexxDoors'
  47. bbs.9='BBS_TEXT'    /* text files for BBS use. WELCOME HELLO, NEW etc. */
  48. bbs.10='FileNotes'
  49. bbs.11='BBS_LIBS'
  50. bbs.12='BBS_MSGS'
  51. bbs.13='Lists'
  52. bbs.14='Numbers'    /* 1st & last messages, mail, files */
  53. bbs.15='Usage'
  54. bbs.16='Logs'
  55. bbs.17='EMailFiles'
  56. bbs.18='EMail'
  57. bbs.19='Users'
  58.  
  59.  
  60. /* VARIABLES */
  61.  
  62. bbsprefs.=0 /* start with all prefs OFF */
  63. alpha.=''
  64. lastread.=0
  65. dirnum=1
  66. linesperpage=18
  67. sortuserflag=0
  68. sortalphaflag=0
  69. savefileflag=0
  70. emailonline=-1
  71. level=0
  72. lastread.=0
  73. totwrit.=0
  74. lastbrowse=0
  75. warnings=0
  76. winnings=0
  77. nonstop=0
  78. newfilesdate=''
  79. newpassword=''
  80. replysubj=''
  81. msgdir=1
  82. menuflag=1
  83. logonflag=1
  84. data.=''
  85.  
  86.  
  87. /* TEXT - This is the user data structure by line */
  88.  
  89. text.=''
  90. text.1='   Full Name'
  91. text.2='      Street'
  92. text.3='City, ST Zip'
  93. text.4=' Voice Phone'
  94. text.5='    Password'
  95. text.6='    Protocol'
  96. text.7='LinesPerPage'
  97. text.8=' Preferences'
  98. text.9='    Computer'
  99. text.10='   Interests'
  100. text.11='Session Time'
  101. text.12='FirstSession'
  102. text.13='Last Session'
  103. text.14='      UpLoad'
  104. text.15='    Download'
  105. text.16='   Last File'
  106. text.17='Ratio  Email'
  107. text.18='    Winnings'
  108. text.19='       Usage'
  109. text.20='       Level'
  110. text.21='Exclude DIRS'
  111. text.22='   Msgs Read'
  112. text.23='   Msgs Writ'
  113.  
  114.  
  115. /* try to trap everything */
  116.  
  117. SIGNAL ON BREAK_C
  118. OPTIONS RESULTS
  119. OPTIONS FAILAT 10
  120. SIGNAL ON BREAK_E
  121. SIGNAL ON SYNTAX
  122. SIGNAL ON FAILURE
  123. NUMERIC DIGITS 14
  124.  
  125.  
  126. ARG option .
  127.  
  128. SAY CENTER(copyright.1,75)
  129. CALL config()
  130.  
  131. IF ~EXISTS(bbspath'Numbers/FirstLogon') THEN
  132.   ADDRESS COMMAND 'C:Date >'bbspath'Numbers/FirstLogon'
  133.  
  134. SAY CENTER(copyright.2,75)
  135. SAY CENTER(copyright.3,75)
  136. SAY CENTER(copyright.4,75)
  137. SAY
  138.  
  139.  
  140. IF option='SETUP' THEN
  141.   DO
  142.     SAY 'Making sure all needed directories are here...'
  143.     DO i=1 TO 20
  144.       IF bbs.i~='' THEN CALL MAKEDIR(bbspath||bbs.i)
  145.     END
  146.   END
  147.  
  148. CALL colors(1)
  149.  
  150. msg.=''
  151. IF readopen(bbspath'Lists/Conferences') THEN
  152.   DO
  153.     DO i=1
  154.       line=READLN(f)
  155.       IF line='END' THEN BREAK
  156.       IF EOF(f) THEN BREAK
  157.       num=WORD(line,1)
  158.       IF DATATYPE(num,'W') THEN msg.num=WORD(line,2)
  159.     END
  160.     CALL CLOSE(f)
  161.   END
  162. IF option='SETUP' THEN
  163.   DO
  164.     DO i=1 TO 99
  165.       IF msg.i~='' THEN CALL MAKEDIR(msgpath||i)
  166.     END
  167.   END
  168.  
  169. courtesy=''
  170. IF EXISTS(bbspath'Lists/Courtesy') THEN
  171.   DO
  172.     IF readopen(bbspath'Lists/Courtesy') THEN
  173.       DO
  174.         DO i=1
  175.           line=READLN(f)
  176.           IF EOF(f) THEN BREAK
  177.           courtesy=courtesy line
  178.         END
  179.         CALL CLOSE(f)
  180.       END
  181.   END
  182.  
  183. dirs.=''
  184. IF readopen(bbspath'Lists/Libraries') THEN
  185.   DO
  186.     DO i=1
  187.       line=READLN(f)
  188.       IF line='END' | EOF(f) THEN LEAVE i
  189.       num=WORD(line,1)
  190.       IF DATATYPE(num,'W') THEN dirs.num=STRIP(WORD(line,2))
  191.     END
  192.     CALL CLOSE(f)
  193.   END
  194. IF option='SETUP' THEN
  195.   DO
  196.     SAY 'Making sure all file library directories are here...'
  197.     DO i=1 TO 99
  198.       IF dirs.i~='' THEN CALL MAKEDIR(libpath||dirs.i)
  199.     END
  200.   END
  201.  
  202. CALL loaduserlist()
  203. SAY '          The larger the BBS gets, the longer the setup takes...'
  204.  
  205. files.=''
  206. IF readopen(bbspath'Lists/Files') THEN
  207.   DO
  208.     DO i=1
  209.       line=READLN(f)
  210.       IF EOF(f) THEN BREAK
  211.       num=WORD(line,1)
  212.       IF DATATYPE(num,'W') THEN files.num=WORD(line,2) WORD(line,3)
  213.     END
  214.     files.0=i-1
  215.     CALL CLOSE(f)
  216.   END
  217.  
  218. IF readopen(bbspath'Lists/Files.ALPHA') THEN
  219.   DO
  220.     DO i=1
  221.       line=READLN(f)
  222.       IF EOF(f) THEN BREAK
  223.       alpha.i=line
  224.       fnum=WORD(line,3)
  225.       files.fnum.0=i
  226.     END
  227.     alpha.0=i-1
  228.     CALL CLOSE(f)
  229.   END
  230.  
  231. CALL set_grand()
  232.  
  233. BIG_LOOP:
  234. /** Identify (title) message */
  235. IF EXISTS(bbspath'BBS_TEXT/HELLO') THEN
  236.   DO
  237.     SAY 
  238.     arg=bbspath'BBS_TEXT/HELLO'
  239.     CALL readlines(arg 1)
  240.     CALL seelines(0)
  241.   END
  242. SAY
  243. SAY pen3'Courtesy List:'def
  244. SAY courtesy
  245. SAY
  246.  
  247.  
  248. /* Ask for name */
  249. name=''
  250. DO count=1 TO 3
  251.   name=getinput(1 0 'Please enter name: ')
  252.   name=SPACE(name,1,'_')
  253.   IF name='NEW' THEN LEAVE count
  254.   IF name~='' THEN
  255.     DO
  256.       IF FIND(userlist,name)>0 THEN LEAVE count
  257.       IF FIND(exclusion,name)>0 THEN
  258.         DO
  259.           SAY 'Sorry, that is a reserved name.'
  260.           name=''
  261.           ITERATE count
  262.         END
  263.       IF bbsprefs.7>0 | FIND(courtesy,name)>0 THEN
  264.         DO
  265.           SAY
  266.           SAY 'Welcome' name'!'
  267.           SAY 'You will be automatically validated after you enter your user info.'
  268.           SAY
  269.           LEAVE count
  270.         END
  271.     END
  272.   IF count<3 THEN SAY 'New Users please enter NEW to apply for validation.'
  273. END
  274. IF count>3 THEN SIGNAL DONE
  275. CALL checkUser()
  276. IF UPPER(WORD(data.12,3))~='BIRTHDAY:' THEN
  277.   DO
  278.     SAY
  279.     SAY 'Please help us out by entering the following information.'
  280.     CALL getbirth()
  281.     SAY '   Thank you!'
  282.   END
  283. CALL checkclips()
  284. city=docity(data.3)
  285.  
  286. CALL TIME('R')
  287.  
  288. IF RIGHT(WORD(data.12,4),4)=RIGHT(DATE('S'),4) THEN
  289.   DO
  290.     arg=bbspath'BBS_TEXT/BIRTHDAY'
  291.     IF EXISTS(arg) THEN 
  292.       DO
  293.         SAY
  294.         CALL showtext(arg)
  295.       END
  296.     SAY
  297.     SAY '***  Happy Birthday,' pen3||data.1||def', and many more!  ***'
  298.     SAY
  299.   END
  300. SAY 
  301.  
  302. CALL bbsLOGON.baud(name level)
  303. CALL sortlibraries()
  304. IF FIND(data.8,'QUICK')>0 THEN CALL do_quick()
  305.  
  306.  
  307. /* Opening Display after logon. Seen by all Users ONCE A DAY. It first  */
  308. /* looks for a unique yearly data (ie, WELCOME.0704), then daily data   */
  309. /* (ie, WELCOME.Fri), and finally a simple, everyday 'WELCOME' datafile */
  310.  
  311. IF DATE('I')>lastondate THEN
  312.   DO
  313.     SAY
  314.     arg=bbspath'BBS_TEXT/WELCOME.'RIGHT(DATE('S'),4)
  315.     IF EXISTS(arg) THEN CALL showtext(arg)
  316.     SAY
  317.     arg=bbspath'BBS_TEXT/WELCOME.'LEFT(DATE('W'),3)
  318.     IF EXISTS(arg) THEN CALL showtext(arg)
  319.     SAY
  320.     arg=bbspath'BBS_TEXT/WELCOME'
  321.     IF EXISTS(arg) THEN CALL showtext(arg)
  322.  
  323. /*
  324. Looks for format UNTIL.YYYYMMDD ie, "UNTIL.19920514"
  325. Deletes any that are previous to "today"
  326. */
  327.  
  328.     untils.=''
  329.     IF FileList(bbspath'BBS_TEXT/UNTIL.*',untils)>0 THEN
  330.       DO
  331.         CALL QSORT(1,untils.0,untils)
  332.         DO ui=1 TO untils.0
  333.           IF RIGHT(untils.ui,8)<DATE('S') THEN CALL DELETE(untils.ui)
  334.           ELSE
  335.             DO
  336.               SAY
  337.               CALL showtext(untils.ui)
  338.             END
  339.         END
  340.       END
  341.     DROP untils.
  342.   END
  343.  
  344. IF bbsprefs.1 & ~terseflag THEN
  345.   DO
  346.     IF doGrin()>3 THEN CALL waiting()
  347.     IF EXISTS(bbspath'rexxDoors/Moon.rexx') THEN CALL Moon.rexx()
  348.     IF EXISTS(bbspath'rexxDoors/Time.rexx') THEN CALL Time.rexx()
  349.     IF FIND(UPPER(SHOWLIST('A')),'TODAY')>0 THEN
  350.       DO
  351.         IF EXISTS('RAM:TODAY') THEN
  352.           DO
  353.             finfo=STATEF('RAM:TODAY')
  354.             IF WORD(finfo,5)~=DATE('I') THEN
  355.               ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  356.           END
  357.         ELSE ADDRESS COMMAND 'C:Today091 >RAM:TODAY'
  358.         IF EXISTS('RAM:TODAY') THEN
  359.           DO
  360.             CALL readlines('RAM:TODAY' 1)
  361.             CALL seelines(0)
  362.           END
  363.       END
  364.     SAY
  365.   END
  366.  
  367. CALL readmail(0)
  368. IF ~terseflag THEN
  369.   DO
  370.     IF level>sysoplevel THEN
  371.       DO
  372.         lstmail=WORD(data.17,3)
  373.         IF ~DATATYPE(lstmail,'W') THEN lstmail=0
  374.         IF countcheck(bbspath'Numbers/LastMail' 0)>lstmail THEN
  375.           IF getinput(1 1 'Check Email? (Ny) > ')='Y' THEN CALL mailreport()
  376.         IF level<99 THEN
  377.           DO
  378.             SAY
  379.             CALL showtext(bbspath'Email/'sysop'/NEW_FILES')
  380.           END
  381.         SAY
  382.         CALL showtext(bbspath'Lists/NEW_USERS')
  383.       END
  384.     CALL logonstats()
  385.     CALL newinfo()
  386.   END
  387. CALL showmarked()
  388. CALL setdir(libpath||dirs.1)
  389. logonflag=0
  390.  
  391.  
  392. /***** MAIN *****/
  393.  
  394. IF menu~='ALL' THEN menu='MAIN'
  395.  
  396. RESTART:
  397. SIGNAL ON BREAK_C
  398. SIGNAL ON BREAK_E
  399. OPTIONS FAILAT 25
  400.  
  401. waitchar=''
  402. string=''
  403. opt=''
  404. IF level<1 THEN menu='NEW'
  405. DO WHILE(opt~='G')
  406.   go=0
  407.   DO WHILE(~go)
  408.     IF waitchar='' | waitchar='?' THEN
  409.       DO
  410.         commands='cghiqsvwxyz!#,'
  411.         IF level>0  THEN commands='abcdefghijlmnoprstuvwxyz!$#&.,+'
  412.         IF level>sysoplevel THEN commands=commands'k%^()=;'
  413.         IF level=99 THEN commands=commands'@~'
  414.         commands=commands'?'
  415.         IF menuflag | waitchar='?' | string='?' THEN
  416.           DO
  417.             opt='MENU'
  418.             arg=''
  419.             CALL menus()
  420.           END
  421.         ELSE SAY pen3'COMMANDS:'def commands
  422.       END
  423.     line=''
  424.     line=line||bak2' 'TIME('C')' 'def
  425.     IF menu='ALL' | menu='FILE' THEN
  426.       line=line pen3'FILE_LIBRARY:'plaindir||def
  427.     ELSE IF menu='MSG' THEN line=line pen3'MESSAGES:'def
  428.     ELSE line=line pen3'MAIN:'def
  429.     IF waitchar='' THEN waitchar=getinput(0 0 line' > ')
  430.     PARSE VAR waitchar string' 'arg
  431.     nonstop=0
  432.     string=UPPER(STRIP(string))
  433.     IF string='OFF' | string='BYE' THEN SIGNAL LOGOUT
  434.     waitchar=''
  435.     IF DATATYPE(string,'W') THEN
  436.       DO
  437.         dirnum=string
  438.         CALL chdir2()
  439.         CALL since()
  440.       END
  441.     IF string='QUICK' THEN CALL do_quick()
  442.     opt=left(string,1)
  443.     go=1    /* check for access */
  444.     IF POS(opt,UPPER(commands))=0 THEN go=0
  445.   END
  446.   OPTIONS PROMPT 'Filename: '
  447.   SELECT
  448.     WHEN opt='A' THEN CALL showalpha()
  449.     WHEN opt='B' THEN CALL browse()
  450.     WHEN opt='C' THEN CALL editor('MAIL' sysop)
  451.     WHEN opt='D' THEN CALL dload()
  452.     WHEN opt='E' THEN CALL readmail(1)
  453.     WHEN opt='F' THEN IF menu~='ALL' THEN menu='FILE'
  454.     WHEN opt='H' THEN CALL help('MAIN')
  455.     WHEN opt='I' THEN CALL information()
  456.     WHEN opt='J' THEN CALL jump2rexx()
  457.     WHEN opt='K' THEN CALL killuser()
  458.     WHEN opt='L' THEN CALL list()
  459.     WHEN opt='M' THEN IF menu~='ALL' THEN menu='MSG'
  460.     WHEN opt='N' THEN CALL newfiles()
  461.     WHEN opt='O' THEN CALL otheruser()
  462.     WHEN opt='P' THEN CALL editor('MSG')
  463.     WHEN opt='R' THEN CALL readmessages()
  464.     WHEN opt='S' THEN CALL bbsSEARCH()
  465.     WHEN opt='U' THEN CALL uload(1)
  466.     WHEN opt='V' THEN CALL showtext(bbspath'Usage/USER.LOG')
  467.     WHEN opt='W' THEN CALL showuserlist()
  468.     WHEN opt='X' THEN CALL switchmenuflag()
  469.     WHEN opt='Y' THEN CALL edituser()
  470.     WHEN opt='Z' THEN CALL counts()
  471.     WHEN opt='~' THEN CALL sysED(1)
  472.     WHEN opt='@' THEN CALL shell()
  473.     WHEN opt='#' THEN CALL switchcolors()
  474.     WHEN opt='$' THEN IF menu='ALL' THEN menu='MAIN'; ELSE menu='ALL'
  475.     WHEN opt='%' THEN CALL editnote()
  476.     WHEN opt='^' THEN CALL readlogs()
  477.     WHEN opt='&' THEN CALL profiles()
  478.     WHEN opt=';' THEN CALL changename()
  479.     WHEN opt='(' THEN CALL filereport()
  480.     WHEN opt=')' THEN CALL mailreport()
  481.     WHEN opt='=' THEN CALL levelreport()
  482.     WHEN opt='+' THEN CALL ext_dload()
  483.     WHEN opt='.' THEN menu='MAIN'
  484.     WHEN opt=',' THEN DO;CALL hourly();CALL waiting();END
  485.     WHEN opt='?' & menuflag THEN CALL help('MAIN')
  486.     OTHERWISE NOP
  487.   END
  488. END
  489. SIGNAL LOGOUT
  490. EXIT;       /* an extra margin of safety */
  491.  
  492.  
  493. /* FUNCTIONS */
  494.  
  495. showtext:
  496. PARSE ARG arg .
  497. IF EXISTS(arg) THEN
  498.   DO
  499.     CALL readlines(arg 1)
  500.     CALL seelines(1)
  501.     nonstop=0
  502.     CALL waiting()
  503.   END
  504. RETURN
  505.  
  506.  
  507. doGrin:
  508. IF ~EXISTS(bbspath'rexxDoors/Grin_du_Jour.rexx') THEN RETURN 0
  509. CALL setdir(bbspath'rexxDoors')
  510. temp=Grin_du_Jour.rexx()
  511. SAY
  512. RETURN temp
  513.  
  514.  
  515. do_quick:
  516. IF FIND(UPPER(data.8),'QUICK')=0 THEN
  517.   DO
  518.     SAY 'The QUICK option is OFF in your current settings.'
  519.     IF getinput(1 1 'Turn the QUICK option ON? (nY) >')='N' THEN RETURN
  520.     data.8=data.8 'QUICK'
  521.     CALL saveData(0)
  522.   END
  523. IF getinput(1 1 'Edit your QUICK exclude list? (Ny) >')='Y' THEN
  524.   DO
  525.     SAY
  526.     SAY 'You may EXCLUDE any of these from your QUICK archives.'
  527.     SAY pen3||LEFT('-',74,'-')||def
  528.     temp=LEFT(' ',10)
  529.     SAY temp'HELLO          - Pre-logon message.'
  530.     SAY temp'WELCOME        - Post-logon message.'
  531.     SAY temp'GOODBYE        - Logoff message.'
  532.     SAY temp'HOURLY         - Average-Minutes-Per-Hour usage graph.'
  533.     SAY temp'STATS.BBS      - Most of the Z command from the main menu.'
  534.     SAY temp'<filename>     - ANY file in the Information area.'
  535.     SAY temp'MESSAGES       - New conference messages.'
  536.     SAY temp'FILELIST       - New file descriptions.'
  537.     SAY pen3||LEFT('-',74,'-')||def
  538.     SAY pen3'Exclude:'def data.26
  539.     SAY 'Enter a space separated list of what you wish to exclude.'
  540.     temp=getinput(1 0 pen3'Exclude: 'def)
  541.     IF temp='' & data.26~='' THEN
  542.       DO
  543.         IF getinput(1 1 'Clear the QUICK exclude list? (nY) > ')~='N' THEN
  544.           data.26=''
  545.       END
  546.     ELSE data.26=temp
  547.     temp='Your QUICK archives will exclude'pen3
  548.     IF data.26='' THEN temp=temp 'nothing!'
  549.     ELSE temp=temp data.26
  550.     SAY temp||def
  551.     SAY
  552.   END
  553. IF GETCLIP('BBS_'name)~='' THEN
  554.   DO
  555.     SAY
  556.     SAY 'The QUICK routines are still working on your archive...'
  557.     SAY 'Please try again later.'
  558.     SAY
  559.     RETURN
  560.   END
  561. quickdir=bbspath'EmailFiles/'name
  562. CALL MAKEDIR(quickdir)
  563. CALL setdir(quickdir)
  564. IF getinput(1 1 'Do you have a QUICKIN file to upload? (Ny) >')='Y' THEN
  565.   DO
  566.     arg='QUICKIN.lha'
  567.     ul=2
  568.     DO WHILE ul=2
  569.       ul=uload(0)
  570.     END
  571.   END
  572. IF EXISTS(bbspath'EmailFiles/'name'/QUICKIN.lha') & level>=sysoplevel THEN
  573.   IF getinput(1 1 'Process your QUICKIN archive [N]ow or at [L]ogoff? (Ln) > ')='N' THEN
  574.     DO
  575.       SAY
  576.       SAY 'Please wait, processing QUICKIN archive...'
  577.       CALL bbsQUICKIN.rexx(name level sysoplevel bbsprefs.6)
  578.       CALL checkclips()
  579.       CALL loadData()
  580.       SAY
  581.     END
  582. arg='RAM:dirlist'
  583. ADDRESS COMMAND 'C:list >'arg quickdir'/QUICK_#? DATES'
  584. IF WORD(STATEF(arg),2)>80 THEN
  585.   DO
  586.     CALL readlines(arg 1)
  587.     CALL seelines(0)
  588.     SAY
  589.   END
  590. efiles=UPPER(SHOWDIR(quickdir))
  591. DO i=1 TO WORDS(efiles)
  592.   arg=WORD(efiles,i)
  593.   IF LEFT(arg,6)='QUICK_' & RIGHT(arg,4)='.LHA' THEN
  594.     DO
  595.       SAY arg 'is' WORD(STATEF(arg),2) 'bytes.'
  596.       qarg=arg
  597.       DO WHILE dload()=1
  598.       END
  599.       IF getinput(1 1 'Delete' qarg'? (nY) > ')~='N' THEN
  600.         DO
  601.           CALL DELETE(quickdir'/'qarg)
  602.           CALL DELETE(quickdir'/'qarg'.xdl')
  603.         END
  604.     END
  605. END
  606. arg=''
  607. SAY
  608. IF GETCLIP('BBS_'name)~='' THEN RETURN
  609. IF getinput(1 1 'Archive new BBS activity? (nY) > ')~='N' THEN
  610.   DO
  611.     CALL SETCLIP('BBS_city',city)
  612.     CALL SETCLIP('BBS_'name'_26',data.26)
  613.     IF FIND(UPPER(data.26),'STATS.BBS')=0 THEN
  614.       CALL SETCLIP('BBS_statsarg',emailonline grand grand2 files.0)
  615.     IF FIND(UPPER(data.26),'MESSAGES')=0 THEN
  616.       CALL SETCLIP('BBS_'name'_22',data.22)
  617.     CALL MAKEDIR(bbspath'EmailFiles/'name)
  618.     ADDRESS AREXX bbsQUICKOUT.rexx name level lastbrowse WORD(data.16,2) data.21
  619.     IF FIND(UPPER(data.26),'MESSAGES')=0 THEN
  620.       DO
  621.         clear_marked=1
  622.         DO i=1 TO level
  623.           IF WORD(data.22,i)~=-1 THEN
  624.             lastread.i=countcheck(bbspath'Numbers/LastMessage'i 0)
  625.         END
  626.         SAY
  627.       END
  628.     IF FIND(UPPER(data.26),'FILELIST')=0 THEN
  629.       lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  630.     newfilesdate=DATE('S') TIME()
  631.     IF writeopen(bbspath'EmailFiles/'name'/Libraries') THEN
  632.       DO
  633.         DO i=1 TO libs.0
  634.           CALL WRITELN(f,libs.i)
  635.         END
  636.         CALL CLOSE(f)
  637.       END
  638.     IF writeopen(bbspath'EmailFiles/'name'/Conferences') THEN
  639.       DO
  640.         DO i=1 TO msgs.0
  641.           CALL WRITELN(f,msgs.i)
  642.         END
  643.         CALL CLOSE(f)
  644.       END
  645.     IF getinput(1 1 'Logoff Now? (nY) >')~='N' THEN
  646.       DO
  647.         SAY 'Your archive will be waiting next time you call...'
  648.         SAY
  649.         SIGNAL LOGOUT2
  650.       END
  651.     CALL saveData(1)
  652.   END
  653. ELSE
  654.   DO
  655.     SAY
  656.     IF getinput(1 1 'Logoff Now? (nY) >')~='N' THEN SIGNAL LOGOUT2
  657.   END
  658. SAY
  659. RETURN
  660.  
  661.  
  662. killuser:
  663. IF level<=sysoplevel THEN RETURN
  664. killcount=0
  665. DO loop=1
  666.   IF arg='' THEN
  667.     DO
  668.       OPTIONS PROMPT 'RETURN=QUIT  Username to Kill: '
  669.       PULL arg
  670.     END
  671.   IF STRIP(arg)='' THEN LEAVE loop
  672.   arg=UPPER(arg)
  673.   arg=SPACE(STRIP(arg),1,'_')
  674.   IF getinput(1 1 'Really kill' arg'? (nY) > ')='N' THEN
  675.     DO
  676.       arg=''
  677.       ITERATE loop
  678.     END
  679.   SAY 'Working...'
  680.   IF readlines(bbspath'Users/'arg 1) THEN
  681.     DO
  682.       SAY 'User' arg 'not found.'
  683.       arg=''
  684.       ITERATE loop
  685.     END
  686.   IF level<=lynes.20 THEN
  687.     DO
  688.       SAY '*** Tsk! Tsk!  Your level is not greater than' arg'.'
  689.       arg=''
  690.       ITERATE loop
  691.     END
  692.   CALL DELETE(bbspath'Users/'arg)
  693.   IF EXISTS(bbspath'Email/'arg) THEN
  694.     DO
  695.       temp=WORDS(SHOWDIR(bbspath'Email/'arg))
  696.       emailonline=emailonline-temp
  697.       ADDRESS COMMAND 'C:DELETE >*' bbspath'Email/'arg 'ALL'
  698.     END
  699.   IF EXISTS(bbspath'EmailFiles/'arg) THEN
  700.     ADDRESS COMMAND 'C:DELETE >*' bbspath'EmailFiles/'arg 'ALL'
  701.   SAY 'User file, Email & EmailFiles for' arg 'have been deleted.'
  702.   killcount=killcount+1
  703.   arg=''
  704. END
  705. IF killcount=0 THEN RETURN
  706. CALL DELETE(bbspath'Lists/USERS')
  707. sortuserflag=1
  708. RETURN
  709.  
  710.  
  711. menus:
  712. SAY
  713. IF menu='NEW' THEN
  714. DO
  715.   SAY pen6'     _________________'def
  716.   SAY pen6'  __/  'pen3'New User Menu'pen6'  \___'def
  717.   SAY pen6' |                        |'def
  718.   SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  719.   SAY pen6' |'def'   ['pen3'I'def']nformation        'pen6'|'def
  720.   SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  721.   SAY pen6' |'def'   ['pen3'W'def']ho is here        'pen6'|'def
  722.   SAY pen6' |'def'   ['pen3'S'def']earch user list   'pen6'|'def
  723.   SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  724.   SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  725.   SAY pen6' |'def'   ['pen3','def'] hourly stats     'pen6'|'def
  726.   SAY pen6' |'def'   ['pen3'X'def'] toggle menus     'pen6'|'def
  727.   SAY pen6' |'def'   ['pen3'#'def'] toggle color     'pen6'|'def
  728.   SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  729.   SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP   'pen6'|'def
  730.   SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  731.   SAY pen6' |________________________|'def
  732. END
  733. ELSE IF menu='MSG' THEN
  734. DO
  735.     SAY pen6'       ____________'def
  736.     SAY pen6'  ____/  'pen3'Messages'pen6'  \_____'def
  737.     SAY pen6' |                       |'def
  738.     SAY pen6' |'def'   ['pen3'H'def']elp              'pen6'|'def
  739.     SAY pen6' |'def'   ['pen3'P'def']ost messages     'pen6'|'def
  740.     SAY pen6' |'def'   ['pen3'R'def']ead messages     'pen6'|'def
  741.     SAY pen6' |'def'   ['pen3'S'def']earch messages   'pen6'|'def
  742.     SAY pen6' |'def'   ['pen3'E'def']mail (private)   'pen6'|'def
  743.     SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP  'pen6'|'def
  744.     SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP  'pen6'|'def
  745. IF(level>sysoplevel) THEN DO
  746.     SAY pen6' |'def'   ['pen3'^'def'] view BBS logs   'pen6'|'def
  747.     SAY pen6' |'def'   ['pen3')'def'] email report    'pen6'|'def
  748.     SAY pen6' |'def'   ['pen3'='def'] level report    'pen6'|'def
  749.     SAY pen6' |'def'   ['pen3';'def'] change username 'pen6'|'def;END
  750. IF(level=99) THEN DO
  751.     SAY pen6' |'def'   ['pen3'~'def'] online editor   'pen6'|'def
  752.     SAY pen6' |'def'   ['pen3'@'def'] dos shell       'pen6'|'def;END
  753.     SAY pen6' |'def'   ['pen3'F'def']iles menu        'pen6'|'def
  754.     SAY pen6' |'def'   ['pen3'.'def'] main menu       'pen6'|'def
  755.     SAY pen6' |_______________________|'def
  756. END
  757. ELSE IF menu='FILE' THEN
  758. DO
  759.     SAY pen6'         _________'def
  760.     SAY pen6'  ______/  'pen3'Files'pen6'  \_______'def
  761.     SAY pen6' |                        |'def
  762.     SAY pen6' |'def'   ['pen3'A'def']lphabetic list    'pen6'|'def
  763.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  764.     SAY pen6' |'def'   ['pen3'B'def']rowse files       'pen6'|'def
  765.     SAY pen6' |'def'   ['pen3'N'def']ew files list     'pen6'|'def
  766.     SAY pen6' |'def'   ['pen3'L'def']ist files         'pen6'|'def
  767.     SAY pen6' |'def'   ['pen3'S'def']earch files       'pen6'|'def
  768.     SAY pen6' |'def'   ['pen3'V'def']iew user log      'pen6'|'def
  769.     SAY pen6' |'def'   ['pen3'U'def']pload             'pen6'|'def
  770.     SAY pen6' |'def'   ['pen3'D'def']ownload           'pen6'|'def
  771.     SAY pen6' |'def'   ['pen3'+'def'] Extra Devices    'pen6'|'def
  772. IF(level>sysoplevel) THEN DO
  773.     SAY pen6' |'def'   ['pen3'K'def']ill a user        'pen6'|'def
  774.     SAY pen6' |'def'   ['pen3'%'def'] edit filenote    'pen6'|'def
  775.     SAY pen6' |'def'   ['pen3'('def'] file report      'pen6'|'def
  776.     SAY pen6' |'def'   ['pen3';'def'] change username  'pen6'|'def;END
  777. IF(level=99) THEN
  778.     SAY pen6' |'def'   ['pen3'@'def'] dos shell        'pen6'|'def
  779.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  780.     SAY pen6' |'def'   ['pen3'.'def'] main menu        'pen6'|'def
  781.     SAY pen6' |________________________|'def
  782. END
  783. ELSE IF menu='MAIN' THEN
  784. DO
  785.     SAY pen6'       _____________'def
  786.     SAY pen6'  ____/  'pen3'Main Menu'pen6'  \_____'def
  787.     SAY pen6' |                        |'def
  788.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  789.     SAY pen6' |'def'   ['pen3'I'def']nfomation         'pen6'|'def
  790.     SAY pen6' |'def'   ['pen3'J'def']ump to doorways   'pen6'|'def
  791.     SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  792.     SAY pen6' |'def'   ['pen3'W'def']ho is here list   'pen6'|'def
  793.     SAY pen6' |'def'   ['pen3'S'def']earch userlist    'pen6'|'def
  794.     SAY pen6' |'def'   ['pen3'O'def']ther users info   'pen6'|'def
  795.     SAY pen6' |'def'   ['pen3'X'def']pert (no menus)   'pen6'|'def
  796.     SAY pen6' |'def'   ['pen3'#'def'] toggle colors    'pen6'|'def
  797.     SAY pen6' |'def'   ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  798.     SAY pen6' |'def'   ['pen3'&'def'] user profiles    'pen6'|'def
  799.     SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  800.     SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  801.     SAY pen6' |'def'   ['pen3'F'def']iles menu         'pen6'|'def
  802.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  803.     SAY pen6' |________________________|'def
  804. END
  805. ELSE IF menu='ALL' THEN
  806. DO
  807.     SAY pen6'     __________________________________________________________'def
  808.     SAY pen6'  __/   'pen3'Main Menu            File Menu          Message Menu 'pen6'  \__'def
  809.     SAY pen6' |                                                                |'def
  810.     SAY pen6' |'def' ['pen3'H'def']elp               ['pen3'A'def']lphabetical list  ['pen3'P'def']ost messages      'pen6'|'def
  811.     SAY pen6' |'def' ['pen3'I'def']nformation        ['pen3'B'def']rowse filenotes   ['pen3'R'def']ead messages      'pen6'|'def
  812.     SAY pen6' |'def' ['pen3'Z'def'] bbs statiZtics   ['pen3'L'def']ist by Library    ['pen3'E'def']mail (private)    'pen6'|'def
  813.     SAY pen6' |'def' ['pen3'Y'def']our user data     ['pen3'N'def']ew files          ['pen3'C'def']omment to SYSOP   'pen6'|'def
  814.     SAY pen6' |'def' ['pen3'O'def']ther users info   ['pen3'D'def']ownload           ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  815.     SAY pen6' |'def' ['pen3'J'def']ump to doorways   ['pen3'U'def']pload             ['pen3'X'def']pert (no menus)   'pen6'|'def
  816.     SAY pen6' |'def' ['pen3'S'def']earch menu        ['pen3'T'def']ransfer protocol  ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  817.     SAY pen6' |'def' ['pen3'&'def'] user profiles    ['pen3'+'def'] Extra Devices    ['pen3'#'def'] toggle colors    'pen6'|'def
  818.     SAY pen6' |'def' ['pen3'G'def']oodbye (logoff)   ['pen3'V'def']iew user log      ['pen3','def'] hourly stats     'pen6'|'def
  819. IF(level>sysoplevel) THEN DO
  820.     SAY pen6' |'def' ['pen3'K'def']ill a user        ['pen3'%'def'] edit filenote    ['pen3'='def'] level report     'pen6'|'def
  821.     SAY pen6' |'def' ['pen3'^'def'] view BBS logs    ['pen3'('def'] file report      ['pen3';'def'] change username  'pen6'|'def;END
  822. IF(level=99) THEN
  823.     SAY pen6' |'def' ['pen3'~'def'] online editor    ['pen3'@'def'] dos shell        ['pen3')'def'] email report     'pen6'|'def
  824.     SAY pen6' |________________________________________________________________|'def
  825. END
  826. SAY
  827. RETURN
  828.  
  829.  
  830. help:
  831. ARG helppath .
  832. SAY
  833. SAY 'For more detailed help, use ['pen3'I'def']nformation commmand to read BBBBS.COMMANDS.'
  834. IF helppath='MAIN' THEN
  835.   SAY 'Commands available from the' pen3||menu||def 'menu:'
  836. frontend=bbspath'BBS_HELP/'helppath
  837. backend='.USER'
  838. IF level=0 THEN backend='.NEW'
  839. ELSE IF level=99 THEN backend='.SUPER'
  840. ELSE IF level>sysoplevel THEN backend='.SYSOP'
  841. CALL showtext(frontend||backend)
  842. RETURN
  843.  
  844.  
  845. waiting:
  846. IF waitchar='Q' THEN
  847.   DO
  848.     waitchar=''
  849.     RETURN
  850.   END
  851. waitchar=''
  852. IF nonstop=1 THEN RETURN
  853. OPTIONS PROMPT pen3'                       RETURN=Continue  'def
  854. PULL waitchar
  855. CALL cleanline(1)
  856. RETURN
  857.  
  858.  
  859. waiting2:
  860. IF nonstop=1 THEN RETURN 0
  861. waitchar=getinput(1 1 pen3'   Q=Quit   N=Non-Stop   RETURN=Continue  'def)
  862. IF waitchar='N' THEN
  863.   DO
  864.     nonstop=1
  865.     SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E        'def
  866.     SAY
  867.     CALL DELAY(100)
  868.     waitchar=''
  869.   END
  870. CALL cleanline(1)
  871. IF waitchar='Q' THEN RETURN 1
  872. RETURN 0
  873.  
  874.  
  875. cleanline:
  876. ARG lflag .
  877. IF colorflag~=1 & lflag=1 THEN RETURN
  878. cline=lineup||LEFT(' ',77)
  879. IF lflag=1 THEN cline=cline||lineup
  880. SAY cline
  881. RETURN
  882.  
  883.  
  884. getinput:
  885. PARSE ARG upflag' 'oneflag' 'pline
  886. OPTIONS PROMPT pline
  887. PARSE PULL inarg
  888. inarg=STRIP(inarg)
  889. IF upflag THEN inarg=UPPER(inarg)
  890. IF oneflag THEN inarg=LEFT(inarg,1)
  891. RETURN inarg
  892.  
  893.  
  894. docity:
  895. PARSE ARG citi
  896. citi=TRANSLATE(citi,'          ','+-.,*/()<>')
  897. DO i=WORDS(citi) TO 1 BY -1
  898.   IF DATATYPE(WORD(citi,i),'N') THEN citi=STRIP(DELWORD(citi,i,1))
  899.   IF UPPER(WORD(citi,i))='USA' THEN citi=STRIP(DELWORD(citi,i,1))
  900. END
  901. citi=SPACE(citi,1)
  902. RETURN STRIP(citi)
  903.  
  904.  
  905. setdir:
  906. PARSE ARG tempdir
  907. CALL PRAGMA('D',STRIP(tempdir))
  908. directory=PRAGMA('D')
  909. slash=LASTPOS('/',directory)
  910. IF slash=0 THEN slash=LASTPOS(':',directory)
  911. plaindir=directory
  912. IF slash>0 THEN plaindir=SUBSTR(plaindir,slash+1)
  913. RETURN
  914.  
  915.  
  916. config:
  917. arg='s:CONFIG.BBS'
  918. IF ~EXISTS(arg) THEN arg='BBS:BBS_TEXT/CONFIG.BBS'
  919. IF readlines(arg 1) THEN
  920.   DO
  921.     SAY 's:CONFIG.BBS and BBS:BBS_TEXT/CONFIG.BBS are both missing!'
  922.     SIGNAL DONE2
  923.   END
  924. compos=POS('/*',lynes.1)
  925. IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  926. bbsname=STRIP(lynes.1)
  927. sysop=WORD(lynes.2,1)
  928. compos=POS('/*',lynes.3)
  929. IF compos>0 THEN lynes.3=LEFT(lynes.3,compos-1)
  930. exclusion=STRIP(lynes.3)
  931. bbsdevice=WORD(lynes.4,1)
  932. sysoplevel=WORD(lynes.5,1)
  933. bbspath=WORD(lynes.6,1)
  934. IF ~EXISTS(bbspath) THEN
  935.   DO
  936.     SAY bbspath 'does not exist!'
  937.     SIGNAL DONE2
  938.   END
  939. testchar=RIGHT(bbspath,1)
  940. IF testchar~='/' & testchar~=':' THEN bbspath=bbspath'/'
  941. CALL SETCLIP('BBS_path',bbspath)
  942. msgpath=WORD(lynes.7,1)
  943. IF ~EXISTS(msgpath) THEN
  944.   DO
  945.     SAY msgpath 'does not exist!'
  946.     SIGNAL DONE2
  947.   END
  948. testchar=RIGHT(msgpath,1)
  949. IF testchar~='/' & testchar~=':' THEN msgpath=msgpath'/'
  950. CALL SETCLIP('BBS_msgpath',msgpath)
  951. msgpath=msgpath'MSG'
  952. libpath=WORD(lynes.8,1)
  953. IF ~EXISTS(libpath) THEN
  954.   DO
  955.     SAY libpath 'does not exist!'
  956.     SIGNAL DONE2
  957.   END
  958. testchar=RIGHT(libpath,1)
  959. IF testchar~='/' & testchar~=':' THEN libpath=libpath'/'
  960. CALL SETCLIP('BBS_libpath',libpath)
  961. extdevs=''
  962. DO i=1 TO WORDS(lynes.10)
  963.   test=WORD(lynes.10,i)
  964.   IF POS(':',test)=0 THEN ITERATE i
  965.   IF LEFT(test,2)='/*' THEN LEAVE i
  966.   extdevs=STRIP(extdevs test)
  967. END
  968. SYSTEM_MSG_LIMIT=WORD(lynes.11,1)
  969. SYSTEM_SPACE_LIMIT=WORD(lynes.12,1)
  970. maxidle=WORD(lynes.13,1)
  971. maxtime=WORD(lynes.14,1)
  972. maxbps=WORD(lynes.15,1)
  973. IF ~DATATYPE(maxbps,'W') THEN maxbps=2400
  974. CALL SETCLIP('BBS_baud',maxbps)
  975. DO i=16 TO 31
  976.   j=i-15
  977.   bbsprefs.j=STRIP(WORD(lynes.i,1))
  978. END
  979. spellpath=WORD(lynes.9,1)
  980. IF bbsprefs.5 & ~EXISTS(spellpath) THEN
  981.   DO
  982.     SAY spellpath 'does not exist!'
  983.     bbsprefs.5=0
  984.   END
  985. IF bbsprefs.10 THEN scratch=bbspath'Scratch'
  986. ELSE scratch='RAM:Scratch'
  987. CALL MAKEDIR(scratch)
  988. IF ~DATATYPE(bbsprefs.16,'W') THEN bbsprefs.16=3
  989. extension=WORD(lynes.32,1)
  990. arccom=lynes.33
  991. compos=POS('/*',lynes.33)
  992. IF compos>0 THEN lynes.33=LEFT(lynes.33,compos-1)
  993. arccom=STRIP(lynes.33)
  994. IF LEFT(extension,1)~='.' THEN
  995.   DO
  996.     extension='.lzh'
  997.     arccom='lharc -m m'
  998.   END
  999. RETURN
  1000.  
  1001.  
  1002. readlogs:
  1003. IF arg='' THEN
  1004.   arg=getinput(1 0 '['pen3'RETURN'def']=TODAY, or enter Log Date ('pen3||DATE('S')||def') > ')
  1005. IF arg='' THEN arg=DATE('S')
  1006. arg=bbspath'Logs/log.'arg
  1007. CALL readlines(arg 1)
  1008. CALL seelines(0)
  1009. nonstop=0
  1010. CALL waiting()
  1011. RETURN
  1012.  
  1013.  
  1014. loadcourtesy:
  1015. IF courtesyflag=0 & courtesy='' & EXISTS(bbspath'Lists/Courtesy') THEN
  1016.   DO
  1017.     IF readopen(bbspath'Lists/Courtesy') THEN
  1018.       DO
  1019.         SAY 'Checking Courtesy List...'
  1020.         DO i=1
  1021.           line=READLN(f)
  1022.           IF EOF(f) THEN BREAK
  1023.           courtesy=courtesy UPPER(line)
  1024.         END
  1025.         CALL CLOSE(f)
  1026.         MSG ''
  1027.         MSG pen3'Courtesy List:'def
  1028.         MSG courtesy
  1029.       END
  1030.   END
  1031. RETURN
  1032.  
  1033.  
  1034. fileheader:
  1035. SAY 'Filename          Bytes File# Library         KeyWords'
  1036. SAY pen3||LEFT('=',77,'=')||def
  1037. RETURN
  1038.  
  1039.  
  1040. showalpha:
  1041. IF DATATYPE(arg,'W') THEN
  1042.   DO
  1043.     dirnum=arg
  1044.     arg=''
  1045.     IF chdir2()>0 THEN RETURN
  1046.     test='Y'
  1047.   END
  1048. ELSE
  1049.   DO
  1050.     test=getinput(1 1 'Show one library only? (Ny) > ')
  1051.     IF test='Y' THEN
  1052.       IF chdir()>0 THEN RETURN
  1053.   END
  1054.  
  1055. showalpha2:
  1056. IF test='Y' THEN filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  1057. ELSE filecount=files.0
  1058. SAY '  'filecount 'files.'
  1059. CALL fileheader()
  1060. count=0
  1061. DO shi=1 TO alpha.0
  1062.   IF test='Y' THEN
  1063.     DO
  1064.       IF count>=filecount THEN LEAVE shi
  1065.       IF UPPER(LEFT(plaindir,12))~=UPPER(LEFT(WORD(alpha.shi,5),12)) THEN
  1066.         ITERATE shi
  1067.     END
  1068.   jj=WORD(alpha.shi,4)
  1069.   IF jj>level | FIND(data.21,UPPER(dirs.jj))>0 THEN
  1070.     ITERATE shi
  1071.   SAY LEFT(alpha.shi,76)
  1072.   count=count+1
  1073.   IF (count+2)//linesperpage=0 THEN
  1074.     IF waiting2() THEN LEAVE shi
  1075. END
  1076. nonstop=0
  1077. IF waitchar~='Q' THEN CALL waiting()
  1078. RETURN
  1079.  
  1080.  
  1081. profiles:
  1082. prodir=bbspath'Profiles'
  1083. CALL MAKEDIR(prodir)
  1084. pros=SHOWDIR(prodir)
  1085. protxt=bbspath'BBS_TEXT/PROFILES'
  1086. IF EXISTS(protxt) THEN CALL showtext(protxt)
  1087. DO lupe=1
  1088.   SAY
  1089.   SAY '       1. Edit 'name'''s user Profile'
  1090.   SAY '       2. View a User Profile'
  1091.   SAY '       3. Search User Profiles'
  1092.   SAY '       4. Browse User Profiles'
  1093.   SAY
  1094.   temp=getinput(1 1 'Enter Selection Number > ')
  1095.   IF temp=1 THEN
  1096.     DO
  1097.       lynes.=''
  1098.       IF EXISTS(prodir'/'name) THEN
  1099.         DO
  1100.           IF readlines(prodir'/'name 1)~=0 THEN ITERATE lupe
  1101.           CALL DELETE(prodir'/'name)
  1102.         END
  1103.       ELSE lynes.0=3
  1104.       lynes.1=name
  1105.       lynes.2='Profile Last Updated:' DATE('W') DATE() TIME('C')
  1106.       lynes.3=LEFT('=',74,'=')
  1107.       IF savelines(prodir'/'name)~=0 THEN
  1108.         DO
  1109.           line='Profile for' name 'failed to save!'
  1110.           SAY line
  1111.           CALL send2log(line)
  1112.           ITERATE lupe
  1113.         END
  1114.       edtype=''
  1115.       CALL bbsEd(4 prodir'/'name)
  1116.       IF readlines(prodir'/'name 1)~=0 THEN CALL DELETE(prodir'/'name)
  1117.       IF lynes.0<4 THEN CALL DELETE(prodir'/'name)
  1118.       pros=SHOWDIR(prodir)
  1119.     END
  1120.   ELSE IF temp=2 THEN
  1121.     DO pf=1
  1122.       totpros=WORDS(pros)
  1123.       DO pfl=1 TO totpros BY 3
  1124.         pfl2=pfl+1
  1125.         pfl3=pfl+2
  1126.         pfline=pen3||RIGHT(pfl,3)||def LEFT(WORD(pros,pfl),21)
  1127.         IF pfl2<=totpros THEN
  1128.           pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(WORD(pros,pfl2),21)
  1129.         IF pfl3<=totpros THEN
  1130.           pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(WORD(pros,pfl3),21)
  1131.         SAY pfline
  1132.         IF nonstop~=1 & ((pfl3%3)//linesperpage)=0 THEN
  1133.           IF waiting(2) THEN LEAVE pfl1
  1134.       END
  1135.       emnum=getinput(1 0 pen3'Select User Profile Number > 'def)
  1136.       IF DATATYPE(emnum,'W') & emnum>0 & emnum<=totpros THEN
  1137.         DO
  1138.           tmp=WORD(pros,emnum)
  1139.           IF level>sysoplevel THEN
  1140.             DO
  1141.               CALL bbsEd(1 prodir'/'tmp)
  1142.               IF readlines(prodir'/'tmp 1)~=0 THEN CALL DELETE(prodir'/'tmp)
  1143.               IF lynes.0<4 THEN CALL DELETE(prodir'/'tmp)
  1144.               pros=SHOWDIR(prodir)
  1145.             END
  1146.           ELSE CALL showtext(prodir'/'tmp)
  1147.         END
  1148.       ELSE LEAVE pf
  1149.     END
  1150.   ELSE IF temp=3 | temp=4 THEN
  1151.     DO
  1152.       searcharg=''
  1153.       nonstop=0
  1154.       IF temp=3 THEN
  1155.         DO
  1156.           searcharg=STRIP(getinput(0 0 'Enter Search Phrase > '))
  1157.           IF searcharg='' THEN ITERATE lupe
  1158.         END
  1159.       DO ui=1 TO WORDS(pros)
  1160.         pro=prodir'/'WORD(pros,ui)
  1161.         IF temp=3 THEN
  1162.           IF textsearch(pro searcharg)=0 THEN ITERATE ui
  1163.         SAY
  1164.         CALL readlines(pro 1)
  1165.         IF nonstop=1 THEN rnonstop=1
  1166.         ELSE rnonstop=0
  1167.         CALL seelines(2)
  1168.         IF rnonstop THEN nonstop=1
  1169.         ELSE IF waiting2()=1 THEN LEAVE ui
  1170.         SAY
  1171.         SAY
  1172.       END
  1173.     END
  1174.   ELSE IF temp='' | LEFT(temp,1)='Q' THEN LEAVE lupe
  1175. END
  1176. DROP pros
  1177. RETURN
  1178.  
  1179.  
  1180. otheruser:
  1181. line=''
  1182. IF level>sysoplevel THEN line='['pen3'R'def']eport or'
  1183. line=line '['pen3'D'def']etails or simple ['pen3'N'def']amelist?'
  1184. IF level>sysoplevel THEN line=line '(Dnr) > '
  1185. ELSE line=line '(Dn) > '
  1186. temp=getinput(1 1 line)
  1187. IF temp='N' THEN
  1188.   DO
  1189.     CALL showuserlist()
  1190.     RETURN
  1191.   END
  1192. ELSE IF level>sysoplevel & temp='R' THEN
  1193.   DO
  1194.     SAY
  1195.     line=''
  1196.     IF getinput(1 1 'Report on inactive users? (nY) > ')~='N' THEN
  1197.       DO
  1198.         CALL cleanline(0)
  1199.         SAY 'INACTIVE_USERS report will be in your email.'
  1200.         line='USERS '
  1201.       END
  1202.     IF getinput(1 1 'Report on actual files vs. filelists? (nY) > ')~='N' THEN
  1203.       DO
  1204.         CALL cleanline(0)
  1205.         line=line'FILES'
  1206.         line=STRIP(line getinput(1 0 'Report only files larger than (0) bytes > '))
  1207.         SAY 'FILELISTS_REPORT will be in your email.'
  1208.       END
  1209.     SAY
  1210.     ADDRESS AREXX bbsREPORT.rexx name line 
  1211.     RETURN
  1212.   END
  1213. SAY
  1214. SAY 'To allow (or not) other users to see your street address and/or phone number,'
  1215. SAY 'add (or delete) STREET and/or PHONE to the line 8 list in ['pen3'Y'def']our userfile.'
  1216. SAY
  1217. SAY 'User specification may include ? wildcard for single characters.'
  1218. SAY 'ie,' pen3's?n'def 'will return all user names containing ''son'', ''sen'', ''sin'', etc.'
  1219. IF arg='' THEN arg=getinput(1 0 pen3'User specification: 'def)
  1220. IF arg='' THEN RETURN
  1221. arg=TRANSLATE(STRIP(arg),'_',' ')
  1222. CALL FileList(bbspath'Users/*'arg'*',wildlist)
  1223. line='Found' wildlist.0 'match'
  1224. IF wildlist.0~=1 THEN line=line'es'
  1225. SAY line'.'
  1226. IF wildlist.0<1 THEN RETURN
  1227. totlines=0
  1228. nextpagebreak=linesperpage-3
  1229. extrainfo=0
  1230. IF level>sysoplevel THEN
  1231.   DO
  1232.     IF getinput(1 1 'Display -sysop only- information? (nY) > ')~='N' THEN
  1233.       extrainfo=1
  1234.   END
  1235. DO i=1 TO wildlist.0
  1236.   CALL readlines(wildlist.i 1)
  1237.   SAY 
  1238.   totlines=totlines+6
  1239.   SAY bak2' 'SUBSTR(wildlist.i,LASTPOS('/',wildlist.i)+1)' 'def
  1240.   SAY lynes.1
  1241.   IF FIND(UPPER(lynes.8),'STREET')>0 THEN
  1242.     DO
  1243.       totlines=totlines+1
  1244.       SAY lynes.2
  1245.     END
  1246.   SAY lynes.3
  1247.   IF FIND(UPPER(lynes.8),'PHONE')>0 THEN
  1248.     DO
  1249.       totlines=totlines+1
  1250.       SAY lynes.4
  1251.     END
  1252.   SAY 'Last time on' bbsname':' DATE(,WORD(lynes.13,1),'S') WORD(lynes.13,2)
  1253.   SAY pen3'Interests:'def lynes.10
  1254.   IF extrainfo THEN
  1255.     DO
  1256.       SAY pen3'   up:'def lynes.14
  1257.       SAY pen3' down:'def lynes.15
  1258.       temptot=0
  1259.       DO j=1 TO WORDS(lynes.23)
  1260.         IF DATATYPE(WORD(lynes.23,j),'W') THEN temptot=temptot+WORD(lynes.23,j)
  1261.       END
  1262.       SAY pen3' writ:'def temptot 'public messages.'
  1263.       SAY pen3'level:'def lynes.20
  1264.       totlines=totlines+4
  1265.       IF lynes.21~='' THEN
  1266.         DO
  1267.           totlines=totlines+1
  1268.           SAY pen3'excluded dirs:'def lynes.21
  1269.         END
  1270.     END
  1271.   IF nonstop~=1 & totlines>=nextpagebreak THEN
  1272.     DO
  1273.       IF waiting2() THEN LEAVE i
  1274.       nextpagebreak=totlines+linesperpage-5
  1275.     END
  1276. END
  1277. nonstop=0
  1278. DROP wildlist.
  1279. IF waitchar~='Q' THEN CALL waiting()
  1280. RETURN
  1281.  
  1282.  
  1283. changename:
  1284. ARG cname
  1285. IF level<=sysoplevel THEN RETURN
  1286. IF cname='' THEN cname=getinput(1 0 'Current Username (include underscore): ')
  1287. IF readlines(bbspath'Users/'cname 1)>0 THEN RETURN
  1288. IF WORD(lynes,20)>=level THEN RETURN
  1289. CALL SETCLIP('BBS_oldname',cname)
  1290. CALL ChangeUserName.rexx()
  1291. cname=GETCLIP('BBS_newname')
  1292. CALL DELETE(bbspath'Lists/USERS')
  1293. sortuserflag=1
  1294. CALL SETCLIP('BBS_oldname')
  1295. CALL SETCLIP('BBS_newname')
  1296. RETURN cname
  1297.  
  1298.  
  1299. levelreport:
  1300. minlev=0
  1301. maxlev=99
  1302. templist=''
  1303. uname=''
  1304. newufile=bbspath'Lists/NEW_USERS'
  1305. IF EXISTS(newufile) THEN
  1306.   DO
  1307.     IF getinput(1 1 'Latest New Users Only? (nY) > ')~='N' THEN
  1308.       DO
  1309.         IF readlines(newufile 1)=0 THEN
  1310.           DO i=2 TO lynes.0
  1311.             templist=STRIP(templist WORD(lynes.i,5))
  1312.           END
  1313.       END
  1314.     ELSE newufile=''
  1315.   END
  1316. ELSE newufile=''
  1317. IF newufile='' THEN
  1318.   DO
  1319.     minlev=getinput(1 0 'Minimum level? (0) > ')
  1320.     maxlev=getinput(1 0 'Maximum level? (99) > ')
  1321.     IF ~DATATYPE(minlev,'W') THEN minlev=0
  1322.     IF ~DATATYPE(maxlev,'W') THEN maxlev=99
  1323.     IF minlev<0 | minlev>99 THEN minlev=0
  1324.     IF maxlev<0 | maxlev>99 THEN maxlev=99
  1325.     templist=userlist
  1326.   END
  1327. DO levi=1 TO WORDS(templist)
  1328.   arg=bbspath'Users/'WORD(templist,levi)
  1329.   CALL readlines(arg 1)
  1330.   IF lynes.20<minlev | lynes.20>maxlev THEN ITERATE levi
  1331.   line=lynes.20 WORD(templist,levi)
  1332.   SAY line
  1333.   IF newufile~='' | WORD(lynes.20,1)<10 | ~DATATYPE(WORD(lynes.20,1),'W') THEN
  1334.     DO
  1335.       SAY line
  1336.       DO levj=1 TO 12
  1337.         SAY pen3'  'lynes.levj||def
  1338.       END
  1339.       SAY pen3'  'lynes.19||def
  1340.     END
  1341.   IF ~DATATYPE(WORD(lynes.20,1),'W') | WORD(lynes.20,1)<10 THEN
  1342.     DO
  1343.       lcom=getinput(1 1 '['pen3'A'def']dd or ['pen3'K'def']ill or ['pen3'R'def']ename or ['pen3'S'def']kip this user? (Akrs) > ')
  1344.       CALL cleanline(0)
  1345.       IF lcom='K' THEN
  1346.         DO
  1347.           arg=WORD(templist,levi)
  1348.           CALL killuser()
  1349.         END
  1350.       ELSE IF lcom='R' THEN
  1351.         DO
  1352.           newname=changename(WORD(templist,levi))
  1353.           IF newname~='' & newname~=WORD(templist,levi) THEN
  1354.             DO
  1355.               temp=WORDINDEX(templist,levi+1)
  1356.               rtemp=''
  1357.               IF temp>0 THEN rtemp=SUBSTR(templist,temp)
  1358.               temp=WORDINDEX(templist,levi)
  1359.               templist=''
  1360.               IF temp>1 THEN templist=STRIP(LEFT(templist,temp-1))
  1361.               templist=STRIP(templist newname rtemp)
  1362.               userlist=userlist newname
  1363.             END
  1364.           levi=levi-1
  1365.           CALL SETCLIP('BBS_newname')
  1366.         END
  1367.       ELSE IF lcom~='S' THEN
  1368.         DO
  1369.           IF readopen(bbspath'BBS_TEXT/DEF.MEMBER') THEN
  1370.             DO
  1371.               DO lvi=1 TO 21
  1372.                 line=READLN(f)
  1373.                 IF lvi=11 THEN lynes.11=line
  1374.                 IF lvi=20 THEN lynes.20=line
  1375.               END
  1376.               lynes.21=line
  1377.               CALL CLOSE(f)
  1378.               edtype=''
  1379.               CALL savelines(arg)
  1380.               SAY lynes.20 WORD(templist,levi) 'has been made a member.'
  1381.             END
  1382.           ELSE SAY 'You need a default member file in BBS_TEXT!  ( BBS_TEXT/DEF.MEMBER )'
  1383.         END
  1384.       IF lcom~='K' & lcom~='R' THEN CALL writenew()
  1385.     END
  1386.   ELSE IF newufile~='' THEN CALL writenew()
  1387. END
  1388. IF newufile~='' THEN CALL DELETE(newufile)
  1389. DROP templist
  1390. RETURN
  1391.  
  1392.  
  1393. writenew:
  1394. arg=WORD(templist,levi)
  1395. IF getinput(1 1 'Write' arg 'an email message? (nY) > ')~='N' THEN
  1396.   DO
  1397.     IF EXISTS(bbspath'BBS_TEXT/EMAIL_WELCOME') THEN
  1398.       IF getinput(1 1 'Use default welcome? (nY) > ')~='N' THEN replysubj='|@NEW@|'
  1399.     CALL editor('MAIL' arg)
  1400.   END
  1401. RETURN
  1402.  
  1403.  
  1404. filereport:
  1405. SAY 'Searching for mismatches between files and filenotes...'
  1406. DO i=1 TO sysoplevel+1
  1407.   IF dirs.i='' THEN ITERATE
  1408.   SAY dirs.i'                               'lineup
  1409.   rfiles=SHOWDIR(libpath||dirs.i)
  1410.   rnotes=SHOWDIR(bbspath'FileNotes/'dirs.i)
  1411.   IF WORDS(rfiles)~=WORDS(rnotes) THEN
  1412.     DO
  1413.       line='Compare files & filenotes in'pen3 dirs.i||def'. '
  1414.       DO j=1 TO WORDS(rfiles)
  1415.         IF FIND(UPPER(rnotes),UPPER(WORD(rfiles,j)))=0 THEN
  1416.           line=line WORD(rfiles,j)
  1417.       END
  1418.       SAY line
  1419.     END
  1420. END
  1421. SAY '07'x
  1422. CALL waiting()
  1423. RETURN
  1424.  
  1425.  
  1426. mailreport:
  1427. SAY 'Checking ALL pending Email...'
  1428. SAY pen3' - Use CTRL-E to Exit -'def
  1429. SAY
  1430. mailrep=SHOWDIR(bbspath'Email','D')
  1431. mailfil=SHOWDIR(bbspath'EmailFiles','D')
  1432. lastemail=WORD(data.17,3)
  1433. IF ~DATATYPE(lastemail,'W') THEN lastemail=0
  1434. IF lastemail=countcheck(bbspath'Numbers/LastMail' 0) THEN
  1435.   DO
  1436.     DROP mailrep. mailfil.
  1437.     RETURN
  1438.   END
  1439. mailynes.=''
  1440. mk=0
  1441. DO mi=1 TO WORDS(mailrep)
  1442.   muser=WORD(mailrep,mi)
  1443.   IF muser=sysop | muser=name THEN ITERATE mi
  1444.   mlist=SHOWDIR(bbspath'Email/'muser)
  1445.   IF WORDS(mlist)>0 THEN SAY lineup||RIGHT(muser,40)
  1446.   DO mj=1 TO WORDS(mlist)
  1447.     fuser=WORD(mlist,mj)
  1448.     IF POS(sysop,fuser)>0 THEN ITERATE mj
  1449.     IF logonflag=0 THEN
  1450.       DO
  1451.         mk=mk+1
  1452.         mailynes.mk=pen3||LEFT(muser,20) 'from'def LEFT(fuser,20) DATE(,WORD(STATEF(bbspath'Email/'muser'/'fuser),5),'I')
  1453.       END
  1454.     IF POS(sysop,fuser)=0 & POS(name,fuser)=0 THEN
  1455.       DO
  1456.         testnum=RIGHT(fuser,LENGTH(fuser)-LASTPOS('.',fuser))
  1457.         IF testnum>emailnum THEN emailnum=testnum
  1458.         IF testnum>lastemail THEN
  1459.           DO
  1460.             CALL showtext(bbspath'Email/'muser'/'fuser)
  1461.             SAY
  1462.             SAY
  1463.             IF waitchar='Q' THEN LEAVE mi
  1464.           END
  1465.       END
  1466.   END
  1467.   IF logonflag=0 & FIND(mailfil,muser)>0 THEN
  1468.     DO
  1469.       efilelist=SHOWDIR(bbspath'EmailFiles/'muser)
  1470.       IF WORDS(efilelist)>0 THEN
  1471.         DO
  1472.           mk=mk+1
  1473.           mailynes.mk=pen3||LEFT(muser,20) 'emailfiles'def efilelist
  1474.         END
  1475.     END
  1476. END
  1477. data.17=WORD(data.17,1) WORD(data.17,2) countcheck(bbspath'Numbers/LastMail' 0)
  1478. IF mk>0 THEN
  1479.   DO
  1480.     lynes.0=mk
  1481.     DO mi=1 TO mk
  1482.       lynes.mi=mailynes.mi
  1483.     END
  1484.     CALL seelines(1)
  1485.     nonstop=0
  1486.     CALL waiting()
  1487.   END
  1488. ELSE SAY 'No unseen Email pending.'
  1489. DROP mailrep. mailfil. mailynes. mlist
  1490. RETURN
  1491.  
  1492.  
  1493. jump2rexx:
  1494. IF ~DATATYPE(jdoors.0,'W') THEN doors.0=0
  1495. IF WORDS(SHOWDIR(bbspath'rexxDoors','F'))~=doors.0 THEN
  1496.   DO
  1497.     jdoors.=''
  1498.     doorlist=SHOWDIR(bbspath'rexxDoors','F')
  1499.     doors.=''
  1500.     doors.0=WORDS(doorlist)
  1501.     DO i=1 TO doors.0
  1502.       doors.i=WORD(doorlist,i)
  1503.     END
  1504.     SAY 'Sorting..'lineup
  1505.     CALL QSORT(1,doors.0,doors)
  1506.     jdoors.0=doors.0%3
  1507.     IF (doors.0//3)>0 THEN jdoors.0=jdoors.0+1
  1508.     DO i=1 TO jdoors.0
  1509.       jdoors.i=LEFT(RIGHT(i,3)'.' LEFT(doors.i,LENGTH(doors.i)-5),24)
  1510.       DO j=1 TO 2
  1511.         k=i+j*jdoors.0
  1512.         IF k<=doors.0 THEN
  1513.           jdoors.i=jdoors.i' 'LEFT(RIGHT(k,3)'.' LEFT(doors.k,LENGTH(doors.k)-5),24)
  1514.       END
  1515.     END
  1516.   END
  1517. DO doorloop=1
  1518.   SAY pen3||LEFT('-',75,'-')||def
  1519.   DO jd=1 TO jdoors.0
  1520.     SAY jdoors.jd
  1521.     IF jd//linesperpage=0 THEN CALL waiting()
  1522.     IF waitchar='Q' THEN RETURN
  1523.   END
  1524.   temp=getinput(1 0 pen3'Select Application Number > 'def)
  1525.   IF ~DATATYPE(temp,'W') | temp<1 | temp>doors.0 THEN RETURN
  1526.   curdir=PRAGMA('D')
  1527.   CALL setdir(bbspath'rexxDoors')
  1528.   CALL SETCLIP('BBS_winnings')
  1529.   savewinnings=0
  1530.   INTERPRET 'call' doors.temp'('name winnings savewinnings colorflag')'
  1531.   testwin=GETCLIP('BBS_winnings')
  1532.   IF DATATYPE(testwin,'N') THEN
  1533.     DO
  1534.       IF testwin>7200 THEN
  1535.         DO
  1536.           SAY 'Although you won' TRUNC(testwin/60) 'minutes, the maximum session time is 120 minutes.'
  1537.           testwin=7200
  1538.         END
  1539.       winnings=testwin
  1540.       IF savewinnings>0 THEN
  1541.         DO
  1542.           maxtime=TRUNC(testwin+TIME('E'))
  1543.           winnings=savewinnings
  1544.         END
  1545.     END
  1546.   CALL setdir(curdir)
  1547.   CALL SETCLIP('BBS_winnings')
  1548. END
  1549. RETURN
  1550.  
  1551.  
  1552. sortlibraries:
  1553. SAY 'Sorting Libraries...'
  1554. count=0
  1555. sdirs.=''
  1556. DO i=1 TO level
  1557.   IF dirs.i='' THEN ITERATE i
  1558.   count=count+1
  1559.   sdirs.count=dirs.i i
  1560. END
  1561. sdirs.0=count
  1562. CALL QSort(1,count,sdirs)
  1563. count=0
  1564. libs.=''
  1565. DO i=1 TO sdirs.0
  1566.   tempnum=WORD(sdirs.i,2)
  1567.   tempdir=WORD(sdirs.i,1)
  1568.   IF FIND(data.21,UPPER(tempdir))=0 THEN
  1569.     DO
  1570.       string=' '
  1571.       IF tempnum<10 THEN string=string' '
  1572.       string=string || tempnum'. 'LEFT(tempdir,14)
  1573.       count=count+1
  1574.       libs.count=string
  1575.     END
  1576. END
  1577. libs.0=count%4
  1578. IF (count//4)>0 THEN libs.0=libs.0+1
  1579. DO i=1 TO libs.0
  1580.   DO j=1 TO 3
  1581.     k=i+j*libs.0
  1582.     IF k<=count THEN libs.i=libs.i||libs.k
  1583.   END
  1584. END
  1585. DROP sdirs.
  1586. CALL sortconferences()
  1587. RETURN
  1588.  
  1589.  
  1590. sortconferences:
  1591. SAY 'Sorting Conferences...'
  1592. count=0
  1593. smsg.=''
  1594. DO i=1 TO level
  1595.   IF msg.i='' THEN ITERATE i
  1596.   count=count+1
  1597.   smsg.count=msg.i i
  1598. END
  1599. smsg.0=count
  1600. CALL QSort(1,count,smsg)
  1601. count=0
  1602. msgs.=''
  1603. DO i=1 TO smsg.0
  1604.   tempnum=WORD(smsg.i,2)
  1605.   tempdir=WORD(smsg.i,1)
  1606.   IF FIND(data.21,tempnum)=0 THEN
  1607.     DO
  1608.       string=' '
  1609.       IF tempnum<10 THEN string=string' '
  1610.       string=string || tempnum'.'
  1611.       IF WORD(data.22,tempnum)='' | WORD(data.22,tempnum)>=0 THEN
  1612.         string=string LEFT(tempdir,20)
  1613.       ELSE string=string pen3'-OFF-'def LEFT(tempdir,14)
  1614.       count=count+1
  1615.       msgs.count=string
  1616.     END
  1617. END
  1618. msgs.0=count%3
  1619. IF (count//3)>0 THEN msgs.0=msgs.0+1
  1620. DO i=1 TO msgs.0
  1621.   DO j=1 TO 2
  1622.     k=i+j*msgs.0
  1623.     IF k<=count THEN msgs.i=msgs.i msgs.k
  1624.   END
  1625. END
  1626. DROP smsg.
  1627. RETURN
  1628.  
  1629.  
  1630. readmessages:
  1631. searcharg=''
  1632. DO FOREVER
  1633.   SAY 
  1634.   PARSE VAR arg temp' 'arg .
  1635.   IF DATATYPE(temp,'W') THEN msgdir=temp
  1636.   ELSE IF LEFT(UPPER(temp),1)='A' THEN
  1637.     DO
  1638.       CALL newmsgs()
  1639.       arg=''
  1640.       RETURN
  1641.     END
  1642.   ELSE IF LEFT(UPPER(temp),1)='M' THEN
  1643.     DO
  1644.       CALL readmarked()
  1645.       arg=''
  1646.       RETURN
  1647.     END
  1648.   ELSE
  1649.     DO
  1650.       SAY 'Select Message Conference By Number, ['pen3'M'def']arked only or ['pen3'A'def']ll Active'
  1651.       IF areaselect() THEN
  1652.         DO
  1653.           IF LEFT(temp,1)='A' THEN CALL newmsgs()
  1654.           IF LEFT(temp,1)='M' THEN CALL readmarked()
  1655.           RETURN
  1656.         END
  1657.     END
  1658.   pline='['pen3'A'def']rchive ['pen3'S'def']earch ['pen3'T'def']oggle ON/OFF'
  1659.   pline=pline '['pen3'R'def']ead ['pen3'Q'def']uit (aqRst) > '
  1660.   IF arg~='' THEN junk=UPPER(LEFT(arg,1))
  1661.   ELSE junk=getinput(1 1 pline)
  1662.   IF junk='Q' THEN RETURN
  1663.   IF junk='A' THEN
  1664.     DO
  1665.       SAY
  1666.       CALL msgcount(msgdir)
  1667.       junk=getinput(1 0 pen3'RETURN'def' to archive new msgs, ['pen3'Q'def']uit, or enter starting message number > ')
  1668.       IF junk='Q' THEN RETURN
  1669.       IF DATATYPE(junk,'W') THEN
  1670.         DO
  1671.           IF junk>lastmess | junk<1 THEN junk=1
  1672.           lastread.msgdir=junk-1
  1673.           CALL savedata(1)
  1674.         END
  1675.       CALL SETCLIP('BBS_MSGS','ON')
  1676.       SAY 'Archiving messages in the'pen3 msg.msgdir def'Conference...'
  1677.       lastread.msgdir=lastmess
  1678.       ADDRESS AREXX ArcMsgs.rexx name msgdir
  1679.       IF emailonline>=0 THEN emailonline=emailonline+1
  1680.       DO WHILE GETCLIP('BBS_MSGS')~=''
  1681.         CALL DELAY(14)
  1682.       END
  1683.       SAY 'When completed, the archive will be attached to email addressed to you.'
  1684.       CALL savedata(1)
  1685.       SAY
  1686.       RETURN
  1687.     END
  1688.   IF junk='S' THEN
  1689.     DO
  1690.       searcharg=''
  1691.       searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  1692.       IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  1693.       searcharg=COMPRESS(searcharg,'*')
  1694.       CALL searchmsgdir()
  1695.       searcharg=''
  1696.       RETURN
  1697.     END
  1698.   IF junk='T' THEN
  1699.     DO
  1700.       line='Turning the' msg.msgdir 'conference'
  1701.       IF WORD(data.22,msgdir)<0 THEN
  1702.         DO
  1703.           line=line pen3'ON'def'.'
  1704.           newdata='0'
  1705.         END
  1706.       ELSE
  1707.         DO
  1708.           line=line pen3'OFF'def'.'
  1709.           newdata='-1'
  1710.         END
  1711.       SAY line
  1712.       dataloc=WORDINDEX(data.22,msgdir)-1
  1713.       data.22=DELWORD(data.22,msgdir,1)
  1714.       IF dataloc>0 THEN data.22=INSERT(newdata' ',data.22,dataloc)
  1715.       CALL sortconferences()
  1716.     END
  1717.   CALL readmsg(0)
  1718.   CALL saveData(1)
  1719.   nonstop=0
  1720.   arg=''
  1721. END
  1722. RETURN
  1723.  
  1724.  
  1725. newmsgs:
  1726. test=UPPER(LEFT(arg,1))
  1727. IF test='' THEN
  1728.   test=getinput(1 1 '['pen3'R'def']ead new messages or ['pen3'A'def']rchive for later download. (aR) > ')
  1729. IF test='A' THEN
  1730.   DO
  1731.     CALL SETCLIP('BBS_MSGS','ON')
  1732.     SAY
  1733.     SAY 'Archiving new conference messages...'
  1734.     ADDRESS AREXX ArcMsgs.rexx name
  1735.     IF emailonline>=0 THEN emailonline=emailonline+1
  1736.     clear_marked=1
  1737.     DO i=1 TO level
  1738.       IF WORD(data.22,i)~=-1 THEN
  1739.         lastread.i=countcheck(bbspath'Numbers/LastMessage'i 0)
  1740.     END
  1741.     DO WHILE GETCLIP('BBS_MSGS')~=''
  1742.       CALL DELAY(14)
  1743.     END
  1744.     SAY 'When completed, the archive will be attached to email addressed to you.'
  1745.     CALL savedata(1)
  1746.     SAY
  1747.     RETURN
  1748.   END
  1749. curmsgdir=msgdir
  1750. SAY 'Scanning all Conferences for new messages..'
  1751. DO newi=1 TO level
  1752.   IF msg.newi='' THEN ITERATE newi
  1753.   msgdir=newi
  1754.   CALL readmsg(1)
  1755.   IF msgcom='Q' THEN LEAVE newi
  1756. END
  1757. CALL saveData(1)
  1758. msgdir=curmsgdir
  1759. nonstop=0
  1760. RETURN
  1761.  
  1762.  
  1763. readmsg:
  1764. ARG quietflag marknum .
  1765. msgcom=''
  1766. IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN RETURN; /* sysop excluded */
  1767. IF WORD(data.22,msgdir)=-1 THEN RETURN;                /*  user excluded */
  1768. entering='Entering'pen3 msg.msgdir def'Message Conference..'
  1769. IF quietflag=0 & marknum='' THEN SAY entering
  1770. IF DATATYPE(WORD(data.22,msgdir),'W') THEN
  1771.   lastread.msgdir=WORD(data.22,msgdir)
  1772. ELSE lastread.msgdir=0
  1773. lstwrt=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  1774. frstwrt=countcheck(bbspath'Numbers/FirstMessage'msgdir 0)
  1775. temp=''
  1776. IF marknum='' THEN
  1777.   DO
  1778.     IF lastread.msgdir>=lstwrt | lastread.msgdir<frstwrt THEN
  1779.       DO
  1780.         lastread.msgdir=lstwrt
  1781.         CALL msgcount(msgdir)
  1782.         IF quietflag=1 & lastread.msgdir=lstwrt THEN RETURN
  1783.         IF nonstop=1 THEN temp=''
  1784.         ELSE temp=getinput(1 0 pen3'Enter starting message number > 'def)
  1785.         IF temp='' THEN temp=lastread.msgdir
  1786.         IF ~DATATYPE(temp,'W') THEN RETURN
  1787.         IF temp<frstwrt THEN temp=frstwrt
  1788.         IF temp>lstwrt THEN temp=lstwrt
  1789.         IF temp<1 THEN temp=1
  1790.         lastread.msgdir=temp-1
  1791.       END
  1792.   END
  1793. ELSE lastread.msgdir=marknum-1
  1794. IF quietflag=1 THEN SAY entering
  1795. dirname=msgpath||msgdir
  1796. msglist.=0 /* set read to 0, unread to 1, and reply >=2 */
  1797. firstmess=999999
  1798. testlist=SHOWDIR(dirname)
  1799. DO i=1 TO WORDS(testlist)
  1800.   test=WORD(testlist,i)
  1801.   IF test>lastread.msgdir THEN msglist.test=1
  1802.   IF test<firstmess THEN firstmess=test
  1803. END
  1804. IF firstmess=999999 THEN firstmess=0
  1805. CALL countcheck(bbspath'Numbers/FirstMessage'msgdir firstmess)
  1806. msgstatus=1
  1807. IF temp='' & marknum='' THEN CALL msgcount(msgdir)
  1808. skipsubj.=''
  1809. skipsubj.0=0
  1810. DO msgloop=1
  1811.   lastreadnum=lastread.msgdir
  1812.   DO WHILE msglist.lastreadnum=0 & lastreadnum<lstwrt
  1813.     lastreadnum=lastreadnum+1
  1814.   END
  1815.   lastread.msgdir=lastreadnum
  1816.   IF lastreadnum=lstwrt & msglist.lstwrt=0 THEN LEAVE msgloop
  1817.   DO mess=lastread.msgdir TO lstwrt+1
  1818.     IF marknum~='' THEN
  1819.       DO
  1820.         IF mess>marknum THEN LEAVE msgloop
  1821.         mess=marknum
  1822.       END
  1823.     IF msglist.mess~=msgstatus THEN ITERATE mess
  1824.     IF msgstatus>1 THEN SAY 'Following the thread, level' msgstatus-1'.'
  1825.     msglist.mess=0
  1826.     arg=dirname'/'mess
  1827.     IF ~EXISTS(arg) THEN
  1828.       DO
  1829.         SAY 'Message number' mess 'is missing.'
  1830.         ITERATE mess
  1831.       END
  1832.     IF ~readopen(arg) THEN ITERATE mess
  1833.     firstline=READLN(f)
  1834.     secondline=READLN(f)
  1835.     thirdline=READLN(f)
  1836.     forthline=READLN(f)
  1837.     CALL CLOSE(f)
  1838.     CALL killmark(msgdir mess)
  1839.     DO skp=1 TO skipsubj.0
  1840.       IF forthline=skipsubj.skp THEN ITERATE mess
  1841.     END
  1842.     IF WORDS(firstline)>2 THEN /* if replies, change their num to >1 */
  1843.       DO
  1844.         thread=SUBSTR(firstline,WORDINDEX(firstline,4))
  1845.         DO tindx=1 TO WORDS(thread)
  1846.           test=WORD(thread,tindx)
  1847.           IF msglist.test~=0 THEN msglist.test=msgstatus+1
  1848.         END
  1849.       END
  1850.     savearg=arg
  1851.     msgcom='A'
  1852.     DO msgloop2=1 WHILE msgcom='A' | msgcom='O'
  1853.       CALL readlines(arg 1)
  1854.       IF nonstop=1 THEN rnonstop=1
  1855.       ELSE rnonstop=0
  1856.       CALL seelines(2)
  1857.       msgcom=''
  1858.       IF rnonstop THEN
  1859.         DO
  1860.           SAY
  1861.           nonstop=1
  1862.           msgcom=''
  1863.         END
  1864.       ELSE
  1865.         DO
  1866.           pline=''
  1867.           IF level<=sysoplevel | WORDS(lynes.3)<3 THEN pline='['pen3'A'def']gain'
  1868.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1869.             pline=pline '['pen3'E'def']dit ['pen3'K'def']ill'
  1870.           IF level>sysoplevel THEN pline=pline '['pen3'M'def']ove'
  1871.           IF WORDS(lynes.3)>3 THEN pline=pline '['pen3'O'def']riginal'
  1872.           pline=pline '['pen3'N'def']onStop ['pen3'R'def']eply'
  1873.           IF level=99 THEN pline=pline '['pen3'!'def']'
  1874.           pline=pline '['pen3'S'def']kip ['pen3'Q'def']uit ['pen3'?'def']'
  1875.           msgcom=getinput(1 0 STRIP(pline)' > ')
  1876.           CALL cleanline(0)
  1877.         END
  1878.       IF DATATYPE(msgcom,'W') & EXISTS(dirname'/'msgcom) THEN
  1879.         DO
  1880.           arg=dirname'/'msgcom
  1881.           IF msgcom>lastread.msgdir THEN lastread.msgdir=msgcom
  1882.           msgcom='A'
  1883.           ITERATE msgloop2
  1884.         END
  1885.       ELSE msgcom=LEFT(msgcom,1)
  1886.       IF msgcom='Q' THEN LEAVE msgloop
  1887.       ELSE IF msgcom='!' & level>sysoplevel THEN
  1888.         DO
  1889.           CALL DELETE(arg)
  1890.           newchar=LEFT(lynes.1,1)
  1891.           IF newchar~='!' THEN newchar='!!'
  1892.           ELSE newchar='  '
  1893.           lynes.1=OVERLAY(newchar,lynes.1,1,2)
  1894.           CALL savelines(arg)
  1895.           ITERATE msgloop2
  1896.         END
  1897.       ELSE IF msgcom='A' THEN ITERATE msgloop2
  1898.       ELSE IF msgcom='M' & level>sysoplevel THEN
  1899.         DO
  1900.           prevmsgdir=msgdir
  1901.           If areaselect()=0 THEN
  1902.             DO
  1903.               himsg=countcheck(bbspath'Numbers/LastMessage'msgdir 0)+1
  1904.               lynes.1='  Msg:' himsg
  1905.               lynes.3='   To:' WORD(lynes.3,2)
  1906.               lynes.5=STRIP(DELWORD(lynes.5,8,1)) msg.msgdir
  1907.               nlyn=lynes.0+1
  1908.               lynes.0=nlyn
  1909.               lynes.nlyn=' *** Moved from the' msg.prevmsgdir 'conference ***'
  1910.               CALL savelines(msgpath||msgdir'/'himsg)
  1911.               CALL countcheck(bbspath'Numbers/LastMessage'msgdir himsg)
  1912.               CALL msgmark(WORD(lynes.3,2) msgdir himsg)
  1913.               CALL readlines(arg 1)
  1914.               CALL DELETE(arg)
  1915.               CALL DELAY(28)
  1916.               lynes.0=7
  1917.               lynes.7='*** Moved to the' msg.msgdir 'conference, message #'himsg' ***'
  1918.               CALL savelines(arg)
  1919.             END
  1920.           msgdir=prevmsgdir
  1921.           msgcom='A'
  1922.         END
  1923.       ELSE IF msgcom='N' THEN
  1924.         DO
  1925.           nonstop=1
  1926.           msgcom=''
  1927.         END
  1928.       ELSE IF msgcom='H' | msgcom='?' THEN
  1929.         DO
  1930.           SAY pen3' - HELP with the Read Messages commands -'def
  1931.           SAY ' RETURN reads the next message in line.'
  1932.           SAY ' 34 will read message number 34, if it exists in this conference.'
  1933.           SAY ' A  reads this message Again (in case it scrolled off screen).'
  1934.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1935.             DO
  1936.           SAY ' E  puts this message into the online Editor.'
  1937.           SAY ' K  deletes a message you wrote. you cannot Kill others!'
  1938.             END
  1939.           IF level>sysoplevel THEN
  1940.           SAY ' M  move this message to a new conference.'
  1941.           SAY ' N  displays all new messages without pausing. CTRL-E to Exit!'
  1942.           SAY ' O  if this message is a reply, will read the Original message.'
  1943.           SAY ' R  enters the message editor to Reply to this message.'
  1944.           SAY ' S  allows you to Skip threads or conferences.'
  1945.         IF level=99 THEN
  1946.           SAY ' !  toggles the do-not-purge! flag for this message.'
  1947.           SAY ' Q  returns to the message menu. (Quit)'
  1948.           SAY
  1949.           CALL waiting()
  1950.           msgcom='A'
  1951.           IF waitchar='Q' THEN LEAVE msgloop
  1952.         END
  1953.       ELSE IF msgcom='E' THEN
  1954.         DO
  1955.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1956.             DO
  1957.               sline=7
  1958.               IF level>sysoplevel THEN sline=1
  1959.               CALL bbsED(sline arg)
  1960.               msgcom='A'
  1961.             END
  1962.         END
  1963.       ELSE IF msgcom='S' & mess<lstwrt THEN
  1964.         DO
  1965.           stemp=''
  1966.           DO WHILE stemp~='T' & stemp~='C'
  1967.             stemp=getinput(1 1 'Skip this ['pen3'T'def']hread or the entire ['pen3'C'def']onference (ct) > ')
  1968.           END
  1969.           IF stemp='T' THEN
  1970.             DO
  1971.               SAY
  1972.               SAY pen3 forthline||def
  1973.               SAY 'Skipping messages with this subject heading...'
  1974.               SAY
  1975.               DO i=lastread.msgdir TO lstwrt
  1976.                 IF msglist.i>1 THEN msglist.i=0
  1977.               END
  1978.               skipsubj.0=skipsubj.0+1
  1979.               sksb=skipsubj.0
  1980.               skipsubj.sksb=forthline
  1981.             END
  1982.           ELSE
  1983.             DO
  1984.               SAY pen3'Skipping to the last message in the'def msg.msgdir pen3'conference.'def
  1985.               lastread.msgdir=lstwrt-1
  1986.               lw=lstwrt-1
  1987.               msglist.lw=0
  1988.               msglist.lstwrt=1
  1989.               LEAVE mess
  1990.             END
  1991.         END
  1992.       ELSE IF msgcom='K' THEN
  1993.         DO
  1994.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1995.             DO
  1996.               IF getinput(1 1 'Really delete' arg'? (Ny) > ')='Y' THEN
  1997.                 DO
  1998.                   IF DELETE(arg)=1 THEN
  1999.                     SAY pen3||arg||def' has been deleted.'
  2000.                   grand=grand-1
  2001.                   msg.msgdir.0=msg.msgdir.0-1
  2002.                 END
  2003.             END
  2004.         END
  2005.       ELSE IF msgcom='O' THEN   /* go back and read original */
  2006.         DO
  2007.           IF WORDS(lynes.3)>3 THEN
  2008.             DO
  2009.               temp=WORD(lynes.3,4)
  2010.               arg=dirname'/'temp
  2011.             END
  2012.           ELSE SAY 'This is the original message.'
  2013.         END
  2014.       ELSE IF msgcom='R' THEN        /*  toname     msgnum  */
  2015.         DO
  2016.           msgnum=WORD(lynes.1,2)
  2017.           forthline=lynes.4
  2018.           IF editor('REPLY' WORD(lynes.2,2) msgnum) THEN /* reply */
  2019.             DO
  2020.               savearg2=arg
  2021.               arg=dirname'/'WORD(lynes.3,4)
  2022.               IF EXISTS(arg) THEN
  2023.                 DO
  2024.                   IF readlines(arg 1) THEN BREAK
  2025.                   xmsg=countcheck(bbspath'Numbers/LastMessage'msgdir mess)
  2026.                   IF WORDS(lynes.1)>3 THEN lynes.1=lynes.1 xmsg
  2027.                   ELSE lynes.1=lynes.1'   Reply' xmsg
  2028.                   CALL DELAY(28)    /* allow 1/2 sec for read to close */
  2029.                   CALL savelines(arg)
  2030.                 END
  2031.               arg=savearg2
  2032.             END
  2033.         END
  2034.       ELSE IF arg~=savearg THEN    /* Continue */
  2035.         DO
  2036.           msgcom='A'
  2037.           arg=savearg
  2038.         END
  2039.     END
  2040.     IF thread~='' THEN
  2041.       DO
  2042.         thread=''
  2043.         msgstatus=msgstatus+1
  2044.       END
  2045.   END
  2046.   IF msgstatus>1 THEN msgstatus=msgstatus-1
  2047. END
  2048. DROP msglist. skipsubj.
  2049. IF quietflag~=1 THEN nonstop=0
  2050. RETURN
  2051.  
  2052.  
  2053. showmarked:
  2054. IF WORDS(data.24)<1 THEN RETURN
  2055. SAY
  2056. SAY pen6'These unread conference messages have been ['pen3'M'pen6']arked as addressed to you:'def
  2057. tempkk=data.24
  2058. DO i=1 TO WORDS(tempkk)
  2059.   tempk=WORD(tempkk,i)
  2060.   PARSE VAR tempk kdir'/'kmsg
  2061.   IF EXISTS(msgpath||kdir'/'kmsg) THEN
  2062.     SAY RIGHT(kmsg,6) 'in the'pen3 msg.kdir def'conference.'
  2063.   ELSE data.24=DELWORD(data24,FIND(data.24,tempk))
  2064. END
  2065. CALL waiting()
  2066. SAY
  2067. RETURN
  2068.  
  2069.  
  2070. killmark:
  2071. PARSE ARG kdir kmsg .
  2072. IF data.24='' THEN RETURN
  2073. markword=FIND(data.24,kdir'/'kmsg)
  2074. IF markword>0 THEN data.24=STRIP(DELWORD(data.24,markword,1))
  2075. RETURN
  2076.  
  2077.  
  2078. readmarked:
  2079. mrknum=WORDS(data.24)
  2080. IF mrknum=0 THEN RETURN
  2081. SAY 'Reading only messages addressed to you...'
  2082. mrklist=data.24
  2083. msgcom=''
  2084. DO rmki=1 TO mrknum WHILE msgcom~='Q'
  2085.   tempk=WORD(mrklist,rmki)
  2086.   PARSE VAR tempk mkdir'/'mkmsg .
  2087.   IF ~EXISTS(msgpath||tempk) THEN
  2088.     DO
  2089.       CALL killmark(mkdir mkmsg)
  2090.       SAY
  2091.       SAY 'Message number' mkmsg 'in the' msg.mkdir 'conference is missing!'
  2092.       SAY
  2093.       ITERATE rmki
  2094.     END
  2095.   msgdir=mkdir
  2096.   savelast=lastread.msgdir
  2097.   CALL readmsg(1 mkmsg)
  2098.   IF mkmsg>savelast THEN lastread.msgdir=mkmsg
  2099.   ELSE lastread.msgdir=savelast
  2100. END
  2101. CALL saveData(1)
  2102. RETURN
  2103.  
  2104.  
  2105. sortnumbers:
  2106. PARSE ARG slist
  2107. IF STRIP(slist)='' THEN RETURN ''
  2108. sorted.=''
  2109. oldest=999999
  2110. newest=0
  2111. newlist=''
  2112. DO si=1 TO WORDS(slist)
  2113.   testword=WORD(slist,si)
  2114.   IF ~DATATYPE(testword,'W') THEN
  2115.     DO
  2116.       testpos=LASTPOS('.',testword)
  2117.       IF testpos>0 THEN tempnum=SUBSTR(testword,testpos+1)
  2118.       ELSE
  2119.         DO
  2120.           newlist=testword newlist
  2121.           ITERATE si
  2122.         END
  2123.     END
  2124.   ELSE tempnum=testword/1
  2125.   IF sorted.tempnum='' THEN
  2126.     DO
  2127.       sorted.tempnum=testword
  2128.       sorted.tempnum.0=1
  2129.       IF DATATYPE(tempnum,'W') THEN
  2130.         DO
  2131.           IF tempnum>newest THEN newest=tempnum
  2132.           IF tempnum<oldest THEN oldest=tempnum
  2133.         END
  2134.     END
  2135.   ELSE newlist=newlist testword
  2136. END
  2137. IF oldest~=999999 & newest~=0 THEN
  2138.   DO si=oldest TO newest
  2139.     IF sorted.si.0=1 THEN newlist=newlist sorted.si
  2140.   END
  2141. DROP sorted. oldest newest
  2142. RETURN STRIP(newlist)
  2143.  
  2144.  
  2145. readmail:
  2146. ARG fromenu .
  2147. replysubj=''
  2148. IF fromenu THEN
  2149.   DO
  2150.     temp=UPPER(arg)
  2151.     arg=''
  2152.     IF temp~='F' & temp~='T' & temp~='W' THEN
  2153.       DO
  2154.         line='Find Email ['pen3'F'def']rom You ['pen3'T'def']o You or ['pen3'W'def']rite New Email (ftw) > 'def
  2155.         temp=getinput(1 1 line)
  2156.         CALL cleanline(0)
  2157.       END
  2158.     IF temp='W' THEN
  2159.       DO
  2160.         CALL editor('MAIL')
  2161.         RETURN
  2162.       END
  2163.     ELSE IF temp='F' THEN
  2164.       DO
  2165.         firsteditline=0
  2166.         picklist.=''
  2167.         picklist.0=0
  2168.         IF getinput(1 1 'Check ALL users? (nY) > ')='N' THEN
  2169.           DO
  2170.             picklist.1=getinput(1 0 'Check EMail From' name 'To Who? > ')
  2171.             picklist.1=SPACE(STRIP(UPPER(picklist.1)),1,'_')
  2172.             picklist.1=COMPRESS(picklist.1,'.,:/*#?^ ')
  2173.             IF picklist.1='' THEN RETURN
  2174.             IF FIND(userlist,picklist.1)=0 THEN
  2175.               DO
  2176.                 SAY '***'pen3 picklist.1 def'does not exist!'
  2177.                 picklist.0=0
  2178.                 RETURN
  2179.               END
  2180.             fmaillist=SHOWDIR(bbspath'EMail/'picklist.1)
  2181.             DO ej=1 TO WORDS(fmaillist)
  2182.               ejname=WORD(fmaillist,ej)
  2183.               uname=ejname
  2184.               caret=LASTPOS('.',uname)
  2185.               IF caret>2 THEN uname=LEFT(uname,caret-1)
  2186.               IF uname=name THEN
  2187.                 DO
  2188.                   arg=bbspath'EMail/'picklist.1'/'ejname
  2189.                   IF EXISTS(arg) THEN
  2190.                     DO
  2191.                       pklst=picklist.0+1
  2192.                       picklist.pklst=picklist.1
  2193.                       picklist.pklst.0=ejname
  2194.                       picklist.0=pklst
  2195.                     END
  2196.                 END
  2197.             END
  2198.             IF picklist.0=0 THEN SAY 'No Email FROM you was found.'
  2199.             ELSE
  2200.               DO
  2201.                 SAY pen3'You have the following Email pending:'def
  2202.                 pickcheck=1
  2203.                 DO WHILE pickcheck~=0
  2204.                   pickcheck=pickfromlist()
  2205.                   IF pickcheck~=0 THEN
  2206.                     DO
  2207.                       firsteditline=5
  2208.                       IF level>sysoplevel THEN firsteditline=1
  2209.                       CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0)
  2210.                       IF ~EXISTS(bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0) THEN
  2211.                         picklist.pickcheck='- KILLED -'
  2212.                     END
  2213.                 END
  2214.               END
  2215.           END
  2216.         ELSE
  2217.           DO
  2218.             SAY pen3'Scanning'def WORDS(userlist) pen3'email directories...'def
  2219.             DO ei=1 TO WORDS(userlist)
  2220.               fmaillist=SHOWDIR(bbspath'EMail/'WORD(userlist,ei))
  2221.               DO ej=1 TO WORDS(fmaillist)
  2222.                 ejname=WORD(fmaillist,ej)
  2223.                 uname=ejname
  2224.                 caret=LASTPOS('.',uname)
  2225.                 IF caret>2 THEN uname=LEFT(uname,caret-1)
  2226.                 IF uname=name THEN
  2227.                   DO
  2228.                     arg=bbspath'EMail/'WORD(userlist,ei)'/'ejname
  2229.                     IF EXISTS(arg) THEN
  2230.                       DO
  2231.                         pklst=picklist.0+1
  2232.                         picklist.pklst=WORD(userlist,ei)
  2233.                         picklist.pklst.0=ejname
  2234.                         picklist.0=pklst
  2235.                       END
  2236.                   END
  2237.               END
  2238.             END
  2239.             IF picklist.0=0 THEN SAY lineup'No Email FROM you was found.                    '
  2240.             ELSE
  2241.               DO
  2242.                 SAY pen3'You have Email pending to the following users:'def
  2243.                 pickcheck=1
  2244.                 DO WHILE pickcheck~=0
  2245.                   pickcheck=pickfromlist()
  2246.                   IF pickcheck~=0 THEN
  2247.                     DO
  2248.                       firsteditline=5
  2249.                       IF level>sysoplevel THEN firsteditline=1
  2250.                       CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0)
  2251.                       IF ~EXISTS(bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0) THEN
  2252.                         picklist.pickcheck='- KILLED -'
  2253.                     END
  2254.                 END
  2255.               END
  2256.           END
  2257.         DROP picklist.
  2258.         RETURN
  2259.       END
  2260.     ELSE IF temp='T' THEN BREAK
  2261.     ELSE RETURN
  2262.   END
  2263. SAY 'Checking your mailbox..'
  2264. nomail=1
  2265. CALL MAKEDIR(bbspath'EMail/'name)
  2266. mailist=sortnumbers(SHOWDIR(bbspath'Email/'name))
  2267. IF WORDS(mailist)=0 THEN RETURN
  2268. line=WORDS(mailist)
  2269. IF line>1 THEN line=line 'letters'
  2270. ELSE line=line 'letter'
  2271. line=line 'waiting.'
  2272. SAY line
  2273. DO ii=1 TO WORDS(mailist)
  2274.   SAY 'Email:' pen3||WORD(mailist,ii)||def
  2275. END
  2276. IF ~fromenu THEN
  2277.   IF getinput(1 1 'Read your private mail now? (nY) > ')='N' THEN RETURN
  2278. onename=''
  2279. IF WORDS(mailist)>3 THEN
  2280.   DO
  2281.     IF getinput(1 1 'Read all private mail? (nY) > ')='N' THEN
  2282.       DO
  2283.         onename=getinput(1 0 'Read ONLY private mail from? > ')
  2284.         onename=SPACE(STRIP(UPPER(onename)),1,'_')
  2285.         onename=COMPRESS(onename,'.,:/*#?^ ')
  2286.         IF onename='' THEN RETURN
  2287.         IF FIND(userlist,onename)=0 & picklist.1~='BBBBS' THEN
  2288.           DO
  2289.             SAY '***'pen3 onename def'does not exist!'
  2290.             RETURN
  2291.           END
  2292.       END
  2293.   END
  2294. DO letter=1 TO WORDS(mailist)
  2295.   readname=WORD(mailist,letter)
  2296.   uname=readname
  2297.   caret=LASTPOS('.',uname)
  2298.   IF caret>2 THEN uname=LEFT(uname,caret-1)
  2299.   IF onename~='' & onename~=uname THEN ITERATE letter
  2300.   arg=bbspath'Email/'name'/'readname        /* user has mail! */
  2301.   CALL readlines(arg 1)
  2302.   CALL seelines(1)
  2303.   nomail=0
  2304.   nonstop=0
  2305.   mailfile=''
  2306.   IF UPPER(WORD(lynes.1,3))='FILE:' THEN mailfile=WORD(lynes.1,4)
  2307.   ELSE IF UPPER(WORD(lynes.2,3))='FILE:' THEN mailfile=WORD(lynes.2,4)
  2308.   IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' THEN
  2309.     DO
  2310.       IF LEFT(RIGHT(mailfile,4),1)~='.' & LEFT(readname,6)='BBBBS.' THEN
  2311.         DO
  2312.           SAY
  2313.           SAY pen3'The attached file is unarchived and may be incomplete.'
  2314.           SAY 'If the archiver is still building this file, downloading will fail.'def
  2315.           IF getinput(1 1 'Do you want to try to download it anyway? (Ny) > ')~='Y' THEN ITERATE letter
  2316.           SAY
  2317.         END
  2318.       curdir=PRAGMA('D')
  2319.       CALL setdir(bbspath'EmailFiles/'name)
  2320.       ADDRESS COMMAND 'C:List >*' mailfile 'DATES'
  2321.       SAY ' Attached file:' pen3||mailfile||def
  2322.       junk=getinput(1 1 'Leave file in your EmailFiles? (Ny) > ')
  2323.       IF junk='Y' THEN mailfile=''
  2324.       ELSE
  2325.         DO
  2326.           junk=getinput(1 1 'Deleting Mail will also delete file. Copy somewhere now? (Ny) > ')
  2327.           IF junk='Y' THEN
  2328.             DO
  2329.               savearg=arg
  2330.               arg=mailfile
  2331.               CALL dload()
  2332.               arg=savearg
  2333.             END
  2334.             CALL setdir(curdir)
  2335.         END
  2336.     END
  2337.   IF readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & LEFT(readname,3)~='MSG' & LEFT(readname,6)~='BBBBS.' THEN
  2338.     DO
  2339.       tempchar='A'
  2340.       DO WHILE tempchar='A'
  2341.         tempchar=getinput(1 1 '['pen3'A'def']gain  ['pen3'C'def']ontinue  ['pen3'R'def']eply? (acR) > ')
  2342.         IF tempchar='' THEN tempchar='R'
  2343.         IF tempchar='A' THEN CALL seelines(1)
  2344.       END
  2345.       IF tempchar='R' THEN
  2346.         DO
  2347.           IF WORDS(lynes.4)<2 THEN replysubj='NONE'
  2348.           ELSE replysubj=SUBSTR(lynes.4,WORDINDEX(lynes.4,2))
  2349.           CALL editor('MAIL' uname)
  2350.           replysubj=''
  2351.         END
  2352.     END
  2353.   IF LEFT(readname,6)~='BBBBS.' THEN
  2354.     DO
  2355.       tempchar='A'
  2356.       DO WHILE tempchar='A'
  2357.         tempchar=getinput(1 1 'Forward mail from'pen3 uname def'to other users? (aNy) > ')
  2358.         IF tempchar='A' THEN CALL seelines(1)
  2359.       END
  2360.       IF tempchar='Y' THEN
  2361.         DO
  2362.           IF selectchosen(1 pen3'Forward Email To: 'def)=0 THEN
  2363.             DO ei=1 TO thechosen.0 WHILE thechosen.ei~=''
  2364.               CALL MAKEDIR(bbspath'EMail/'thechosen.ei)
  2365.               forwardarg=bbspath'Email/'thechosen.ei'/'readname
  2366.               ADDRESS COMMAND 'C:COPY' bbspath'Email/'name'/'readname forwardarg
  2367.               CALL readlines(forwardarg 1)
  2368.               lynes.1=lynes.1'  Forwarded to you by' name TIME('C') DATE()
  2369.               CALL DELETE(forwardarg)
  2370.               CALL savelines(forwardarg)
  2371.               IF WORDS(lynes.2)>3 THEN
  2372.                 DO
  2373.                   forname=bbspath'EmailFiles/'name'/'WORD(lynes.2,4)
  2374.                   IF EXISTS(forname) THEN
  2375.                     DO
  2376.                       CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ei)
  2377.                       ADDRESS COMMAND 'C:COPY' forname bbspath'EmailFiles/'thechosen.ei
  2378.                     END
  2379.                 END
  2380.               line='Mail' pen3||readname||def 'forwarded to' pen3||thechosen.ei||def
  2381.               IF emailonline>=0 THEN emailonline=emailonline+1
  2382.               SAY line
  2383.             END
  2384.         END
  2385.     END
  2386.   tempchar=getinput(1 1 'Delete the mail from'pen3 uname def'you just read? (nqY) > 'def)
  2387.   IF tempchar='Q' THEN
  2388.     DO
  2389.       IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN
  2390.         DO
  2391.           readname=''
  2392.           uname=''
  2393.           RETURN
  2394.         END
  2395.     END
  2396.   ELSE IF tempchar~='N' THEN
  2397.     DO
  2398.       dirname=bbspath'Email/'name'/'
  2399.       nodelete=0
  2400.       IF bbsprefs.14=1 & name~=sysop & uname~=sysop & WORD(lynes.2,2)~='BBBBS' & WORD(lynes.2,2)~=sysop & WORD(lynes.3,2)~=sysop THEN
  2401.         nodelete=1
  2402.       IF nodelete THEN
  2403.         ADDRESS COMMAND 'C:Copy' dirname||readname bbspath'Email/'sysop
  2404.       ELSE emailonline=emailonline-1
  2405.       CALL DELETE(dirname||readname)
  2406.       tempstr='Old email'
  2407.       IF mailfile~='' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' & EXISTS(bbspath'EmailFiles/'name'/'mailfile) THEN
  2408.         DO
  2409.           IF nodelete THEN
  2410.             ADDRESS COMMAND 'C:Copy' bbspath'EmailFiles/'name'/'mailfile bbspath'EmailFiles/'sysop
  2411.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile)
  2412.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile'.xdl')
  2413.           tempstr=tempstr 'and attached file'
  2414.         END
  2415.       tempstr=tempstr 'deleted. Thank you for keeping a clean BBS!'
  2416.       SAY tempstr
  2417.       IF tempchar='Q' THEN
  2418.         IF getinput(1 1 'Quit reading your Email? (Ny) > ')='Y' THEN
  2419.           DO
  2420.             readname=''
  2421.             uname=''
  2422.             RETURN
  2423.           END
  2424.     END
  2425.   ELSE IF LEFT(readname,3)='MSG' & level>sysoplevel THEN
  2426.     DO
  2427.       ii=LEFT(readname,POS('.',readname)-1)
  2428.       ii=SUBSTR(ii,4)%1
  2429.       IF getinput(1 1 'Move this message back to the' msg.ii 'conference? (nY) > 'def)~='N' THEN
  2430.         DO
  2431.           temp=TRANSLATE(readname,'/','.')
  2432.           temp=SUBSTR(temp,4)
  2433.           lynes.1='!!'STRIP(lynes.1)
  2434.           edtype=''
  2435.           CALL savelines(msgpath||temp)
  2436.           CALL DELETE(bbspath'Email/'name'/'readname)
  2437.         END
  2438.     END
  2439.   ELSE IF LEFT(readname,3)~='MSG' & readname~='NEW_FILES' & readname~='FILELISTS_REPORT' & readname~='INACTIVE_USERS' THEN
  2440.     DO
  2441.       arg=bbspath'Email/'name'/'readname
  2442.       CALL readlines(arg 1)
  2443.       IF WORDS(lynes.5)<7 THEN
  2444.         DO
  2445.           lynes.5=lynes.5'  (Rcvd)' DATE('W') DATE() TIME('C')
  2446.           CALL DELETE(arg)
  2447.           CALL savelines(arg)
  2448.           SAY 'Email has been marked as received.'
  2449.         END
  2450.     END
  2451.   readname=''
  2452.   uname=''
  2453.   arg=''
  2454. END
  2455. IF nomail THEN
  2456.   DO
  2457.     SAY 'No mail was found.'
  2458.     CALL waiting()
  2459.   END
  2460. CALL setdir(libpath||dirs.1)
  2461. thechosen.=''
  2462. RETURN
  2463.  
  2464.  
  2465. selectchosen:
  2466. PARSE ARG startat selectline
  2467. IF startat<2 THEN thechosen.=''
  2468. line='Enter list of comma separated user names'
  2469. IF level>sysoplevel THEN line=line 'or ALL'
  2470. SAY line
  2471. thechosen.startat=getinput(1 0 selectline' ')
  2472. IF STRIP(thechosen.startat)='' THEN RETURN 1
  2473. thechosen.startat=SPACE(thechosen.startat,1,'_')
  2474. thechosen.0=startat
  2475. IF level>sysoplevel & thechosen.startat='ALL' THEN
  2476.   thechosen.startat=SHOWDIR(bbspath'Users','F',',')
  2477. IF POS(',',thechosen.startat)>0 THEN
  2478.   DO
  2479.     temp=TRANSLATE(thechosen.startat,' ',',')
  2480.     thechosen.0=thechosen.0+WORDS(temp)-1
  2481.     DO ei=1 TO WORDS(temp)
  2482.       eii=startat+ei-1
  2483.       thechosen.eii=STRIP(WORD(temp,ei))
  2484.     END
  2485.   END
  2486. DO ei=startat TO thechosen.0
  2487.   DO WHILE FIND(userlist,thechosen.ei)=0
  2488.     IF thechosen.ei~='' THEN
  2489.       DO
  2490.         IF FIND(exclusion,thechosen.ei)>0 | thechosen.ei='BBBBS' THEN
  2491.           DO
  2492.             thechosen.ei=sysop
  2493.             ITERATE ei
  2494.           END
  2495.         CALL loadcourtesy()
  2496.         IF FIND(courtesy,thechosen.ei)>0 THEN ITERATE ei
  2497.       END
  2498.     SAY thechosen.ei 'not found! Enter that name again or press RETURN.'
  2499.     thechosen.ei=getinput(1 0 pen3||selectline' 'def)
  2500.     IF thechosen.ei='' THEN
  2501.       DO
  2502.         IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  2503.           CALL showuserlist()
  2504.         ITERATE ei
  2505.       END
  2506.     thechosen.ei=SPACE(thechosen.ei,1,'_')
  2507.   END
  2508. END
  2509. RETURN 0
  2510.  
  2511.  
  2512. countcheck:
  2513. PARSE ARG fname' 'cknum' '.
  2514. IF ~EXISTS(fname) THEN
  2515.   DO
  2516.     IF cknum=0 THEN RETURN 0
  2517.     IF ~writeopen(fname) THEN RETURN 0
  2518.     CALL WRITELN(f,cknum)
  2519.     CALL CLOSE(f)
  2520.     RETURN cknum
  2521.   END
  2522. IF ~readopen(fname) THEN RETURN cknum
  2523. retval=STRIP(READLN(f))
  2524. CALL CLOSE(f)
  2525. IF ~DATATYPE(retval,'W') THEN retval=0
  2526. IF ~DATATYPE(cknum,'W') THEN cknum=0
  2527. IF retval<cknum THEN
  2528.   DO
  2529.     IF writeopen(fname) THEN
  2530.       DO
  2531.         CALL WRITELN(f,cknum)
  2532.         CALL CLOSE(f)
  2533.         RETURN cknum
  2534.       END
  2535.   END
  2536. RETURN retval
  2537.  
  2538.  
  2539. pickfromlist:
  2540. DO pfl=1 TO picklist.0 BY 3
  2541.   pfl2=pfl+1
  2542.   pfl3=pfl+2
  2543.   pfline=pen3||RIGHT(pfl,3)||def LEFT(picklist.pfl,21)
  2544.   IF picklist.pfl2~='' THEN
  2545.     pfline=pfline pen3||RIGHT(pfl2,3)||def LEFT(picklist.pfl2,21)
  2546.   IF picklist.pfl3~='' THEN
  2547.     pfline=pfline pen3||RIGHT(pfl3,3)||def LEFT(picklist.pfl3,21)
  2548.   SAY pfline
  2549. END
  2550. emnum=getinput(1 0 pen3'Select Email Number > 'def)
  2551. IF ~DATATYPE(emnum,'W') | emnum<1 | emnum>picklist.0 THEN RETURN 0
  2552. RETURN emnum
  2553.  
  2554.  
  2555. sysED:
  2556. IF level<99 THEN RETURN
  2557. arg=getinput(0 0 'Textfile To Edit: ')
  2558. IF arg='' THEN RETURN
  2559. CALL bbsED(1 arg)
  2560. RETURN
  2561.  
  2562.  
  2563. bbsED:
  2564. PARSE ARG firstedit editarg .
  2565. notchanged=1
  2566. IF readlines(editarg 1) THEN RETURN 1
  2567. finfo=STATEF(editarg)
  2568. IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  2569. ELSE finfo=''
  2570. SAY 
  2571. SAY '                   'pen3'Entering the EDITOR module..'def
  2572. SAY 
  2573. count=1
  2574. DO edloop=1
  2575.   IF edcom='S' & bbsprefs.5 THEN  /* spell check */
  2576.     DO
  2577.       SAY pen3'You must use ['def'R'pen3']eplace to make corrections.  'pen2'Spellchecking...'def
  2578.       CALL DELETE(scratch'/SpellLOCAL')
  2579.       CALL savelines(scratch'/SpellLOCAL')
  2580.       curdir=PRAGMA('D')
  2581.       CALL setdir(spellpath)
  2582.       CALL SpellChk.rexx(scratch'/SpellLOCAL')
  2583.       CALL setdir(curdir)
  2584.     END
  2585.   ELSE
  2586.     DO
  2587.       IF edcom='R' | edcom='I' | edcom='L' THEN CALL wrapbuf(7)
  2588.       IF edcom~='L' THEN count=count-linesperpage
  2589.       IF count>=lynes.0 | count<1 THEN count=1
  2590.       startcount=count
  2591.       DO i=startcount TO lynes.0+1
  2592.         IF ((i+1-startcount)//linesperpage)=0 THEN
  2593.           DO
  2594.             pline='                 ['pen3'E'def']dit'
  2595.             pline=pline '  ['pen3'RETURN'def']=Continue '
  2596.             edcom=getinput(1 1 pline)
  2597.             IF edcom~='' THEN LEAVE i
  2598.             CALL cleanline(1)
  2599.           END
  2600.         SAY pen3||RIGHT(i,2)||def lynes.i
  2601.         count=count+1
  2602.       END
  2603.     END
  2604.   SAY lineup'     ['pen3'A'def']ppend ['pen3'C'def']ut     ['pen3'I'def']nsert  ['pen3'K'def']ill       ['pen3'?'def'] Help'
  2605.   pline='     ['pen3'L'def']ist   ['pen3'P'def']aste   ['pen3'R'def']eplace'
  2606.   IF bbsprefs.5 THEN pline=pline '['pen3'S'def']pellcheck'
  2607.   pline=pline '['pen3'U'def']pload-Text > '
  2608.   edcom=getinput(1 0 pline)
  2609.   IF edcom='Q' | edcom='X' THEN edcom=''
  2610.   IF edcom='?' THEN
  2611.     DO
  2612.       SAY
  2613.       SAY '                   Editor Help'
  2614.       SAY '-------------------------------------------------------'
  2615.       SAY ' 7  edits line number 7, if it exists.'
  2616.       SAY ' a  Append text to this file.'
  2617.       SAY ' c  Cut selected line(s) of text to buffer.'
  2618.       SAY ' i  Insert blank line.'
  2619.       SAY ' k  Kill (delete) this file.'
  2620.       SAY ' l  List this file from selected line.'
  2621.       SAY ' p  Paste buffer contents to selected line number.'
  2622.       SAY ' r  Replace a phrase or line of text.'
  2623.       SAY ' s  Spellcheck this file.'
  2624.       SAY ' u  Upload a textfile to append to this file.'
  2625.       SAY '    An empty RETURN indicates you are finished editing.'
  2626.       SAY '-------------------------------------------------------'
  2627.       SAY
  2628.       OPTIONS PROMPT ''
  2629.       PULL
  2630.     END
  2631.   IF edcom='K' THEN
  2632.     DO
  2633.       junk=getinput(1 1 'Are you' pen3'sure'def 'you want to delete' editarg'? (Ny) > ')
  2634.       IF junk='Y' THEN
  2635.         DO
  2636.           IF DELETE(editarg)=1 THEN SAY editarg 'DELETED.'
  2637.           IF WORD(lynes.1,1)='Mail:' & WORDS(lynes.2)>3 THEN
  2638.             DO
  2639.               IF DELETE(bbspath'EmailFiles/'WORD(lynes.3,2)'/'WORD(lynes.2,4))=1 THEN
  2640.                 SAY WORD(lynes.2,4) 'DELETED.'
  2641.             END
  2642.           RETURN 2
  2643.         END
  2644.     END
  2645.   IF edcom='' THEN
  2646.     DO
  2647.       SAY '                   'pen3'Leaving the EDITOR module.'def
  2648.       IF notchanged THEN RETURN 0
  2649.       IF getinput(1 1 '                     Save changes? (nY)'pen3' > 'def)='N' THEN
  2650.         RETURN 1
  2651.       CALL DELETE(editarg)
  2652.       IF savelines(editarg) THEN RETURN 1
  2653.       CALL DELAY(28)
  2654.       IF finfo~='' THEN ADDRESS COMMAND 'C:filenote' editarg finfo
  2655.       SAY pen3'                        Changes saved.'def
  2656.       RETURN 0
  2657.     END
  2658.   ELSE IF edcom='C' THEN  /* Cut */
  2659.     DO
  2660.       firstnum=getinput(1 0 '   Enter line number or range 'pen3'(5-7)'def' to cut' pen3'>'def)
  2661.       IF firstnum='' THEN ITERATE edloop
  2662.       dash=POS('-',firstnum)
  2663.       IF dash>0 THEN
  2664.         DO
  2665.           lastnum=STRIP(SUBSTR(firstnum,dash+1))
  2666.           firstnum=STRIP(LEFT(firstnum,dash-1))
  2667.         END
  2668.       ELSE lastnum=firstnum
  2669.       IF ~DATATYPE(firstnum,'W') | ~DATATYPE(lastnum,'W') THEN
  2670.         DO
  2671.           junk=getinput(1 1 pen3'*** You must enter numbers here! 'def)
  2672.           ITERATE edloop
  2673.         END
  2674.       IF lastnum>lynes.0 THEN lastnum=lynes.0
  2675.       IF firstnum<firstedit THEN
  2676.         DO
  2677.           SAY '*** You are not authorized to delete that line!'
  2678.           SAY
  2679.           ITERATE edloop
  2680.         END
  2681.       IF firstnum>lastnum THEN
  2682.         DO
  2683.           SAY '*** Input error!  First number larger than last number'
  2684.           ITERATE edloop
  2685.         END
  2686.       notchanged=0
  2687.       numdiff=lastnum+1-firstnum
  2688.       pasted.=''
  2689.       pasted.0=numdiff
  2690.       k=0
  2691.       DO i=firstnum TO lynes.0
  2692.         j=i+numdiff
  2693.         k=k+1
  2694.         IF k<=numdiff THEN pasted.k=lynes.i
  2695.         lynes.i=lynes.j
  2696.         lynes.j=''
  2697.       END
  2698.       lynes.0=lynes.0-numdiff
  2699.       count=1
  2700.     END
  2701.   ELSE IF edcom='A' THEN  /* append */
  2702.     DO
  2703.       CALL writebuffer(scratch'/EditorLOCAL')
  2704.       notchanged=0
  2705.     END
  2706.   ELSE IF edcom='U' THEN  /* fileappend (upload) */
  2707.     DO
  2708.       frompath=GETCLIP('BBS_frompath')
  2709.       IF frompath='' THEN frompath=libpath'SysOps'
  2710.       farg=GetFile(150,36,frompath,'',' Select TextFile to Append ')
  2711.       IF farg~='' & EXISTS(farg) THEN
  2712.         DO
  2713.           CALL readlines(farg lynes.0+1)
  2714.           notchanged=0
  2715.           CALL SETCLIP('BBS_frompath',WORD(lastslash(farg),2))
  2716.         END
  2717.     END
  2718.   ELSE IF edcom='I' | edcom='R' | edcom='L' | edcom='P' | DATATYPE(edcom,'W') THEN
  2719.     DO
  2720.       IF DATATYPE(edcom,'W') THEN
  2721.         DO
  2722.           ednum=edcom
  2723.           edcom='R'
  2724.         END
  2725.       ELSE
  2726.         DO
  2727.           line=pen3'   '
  2728.           IF edcom='L' | edcom='P' THEN line=line'Starting '
  2729.           line=line'Line Number? > 'def
  2730.           ednum=getinput(1 0 line)
  2731.         END
  2732.       IF ~DATATYPE(ednum,'W') THEN ITERATE edloop
  2733.       IF ednum>(lynes.0+1) THEN ITERATE edloop
  2734.       IF edcom='L' THEN
  2735.         DO
  2736.           count=ednum
  2737.           ITERATE edloop
  2738.         END
  2739.       IF ednum=1 & UPPER(WORD(lynes.1,1))='FILE:' THEN
  2740.         DO
  2741.           IF getinput(1 1 pen3'Edit KeyWords:? (Ny) > 'def)='Y' THEN
  2742.             DO
  2743.               filenum=STRIP(WORD(lynes.1,2))
  2744.               num=files.filenum.0
  2745.               keywords=edkeywords(editarg)
  2746.               lynes.1=LEFT(lynes.1,21) keywords
  2747.               alpha.num=TRIM(OVERLAY(keywords,alpha.num,47,32))
  2748.               savefileflag=1
  2749.               notchanged=0
  2750.               ITERATE edloop
  2751.             END
  2752.         END
  2753.       IF ednum<firstedit THEN
  2754.         DO
  2755.           SAY '*** You are not authorized to alter that line!'
  2756.           SAY
  2757.           ITERATE edloop
  2758.         END
  2759.       IF edcom='R' THEN   /* replace */
  2760.         DO
  2761.           SAY '   Now reads:'
  2762.           SAY pen3||RIGHT(ednum,2)||def lynes.ednum
  2763.           OPTIONS PROMPT pen3'........Search text? >'def
  2764.           PARSE PULL stext
  2765.           IF LENGTH(stext)=0 THEN
  2766.             DO
  2767.               IF getinput(1 1 lineup||pen3'Replace entire line? (nY) >'def)='N' THEN
  2768.                 ITERATE edloop
  2769.               lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)' 'def)
  2770.               notchanged=0
  2771.               ITERATE edloop
  2772.             END
  2773.           found=POS(UPPER(stext),UPPER(lynes.ednum))
  2774.           IF found=0 THEN
  2775.             DO
  2776.               SAY
  2777.               SAY stext' was not found!'
  2778.               SAY
  2779.               ITERATE edloop
  2780.             END
  2781.           OPTIONS PROMPT pen3'...Replacement text? >'def
  2782.           PARSE PULL rtext
  2783.           lynes.ednum=DELSTR(lynes.ednum,found,LENGTH(stext))
  2784.           lynes.ednum=INSERT(rtext,lynes.ednum,found-1)
  2785.           IF ednum<4 & LEFT(lynes.1,6)='File: ' THEN
  2786.             DO
  2787.               PARSE VAR lynes.1 'File: 'filenum . 'KeyWords: 'keywords
  2788.               PARSE VAR lynes.3 . 'Lib:' libnam
  2789.               filenum=STRIP(filenum)
  2790.               newc=files.filenum.0
  2791.               libnum=finddirnum(libnam)
  2792.               alpha.newc=LEFT(WORD(lynes.2,2),22-LENGTH(WORD(lynes.2,4)))
  2793.               alpha.newc=alpha.newc WORD(lynes.2,4) RIGHT(filenum,5)
  2794.               alpha.newc=alpha.newc RIGHT(libnum,2) LEFT(STRIP(libnam),12)
  2795.               alpha.newc=alpha.newc STRIP(LEFT(STRIP(keywords),32))
  2796.               savefileflag=1
  2797.             END
  2798.           SAY 'Done.'
  2799.           SAY 
  2800.           notchanged=0
  2801.         END
  2802.       ELSE IF edcom='I' THEN  /* insert */
  2803.         DO
  2804.           DO i=lynes.0 TO ednum BY -1
  2805.             j=i+1
  2806.             lynes.j=lynes.i
  2807.           END
  2808.           lynes.ednum=''
  2809.           notchanged=0
  2810.           lynes.0=lynes.0+1
  2811.           lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)'>'def)
  2812.         END
  2813.       ELSE IF edcom='P' THEN   /* paste */
  2814.         DO
  2815.           DO i=lynes.0 TO ednum BY -1
  2816.             j=i+pasted.0
  2817.             lynes.j=lynes.i
  2818.           END
  2819.           DO k=1 TO pasted.0
  2820.             kk=ednum+k-1
  2821.             lynes.kk=pasted.k
  2822.           END
  2823.           notchanged=0
  2824.           lynes.0=lynes.0+pasted.0
  2825.         END
  2826.     END
  2827. END
  2828. RETURN 0
  2829.  
  2830.  
  2831. editor:
  2832. toname=''
  2833. msgnum=0
  2834. thechosen.=''
  2835. PARSE ARG edtype toname msgnum .
  2836. IF edtype='MAIL' THEN lastwrit=countcheck(bbspath'Numbers/LastMail 0')
  2837. ELSE 
  2838.   DO
  2839.     IF edtype='MSG' THEN
  2840.       DO
  2841.         tempmsgdir=0
  2842.         IF DATATYPE(arg,'W') THEN tempmsgdir=arg
  2843.         IF tempmsgdir>0 & tempmsgdir<=level & msg.tempmsgdir~='' THEN
  2844.           msgdir=tempmsgdir
  2845.         ELSE IF areaselect() THEN RETURN
  2846.       END
  2847.     lastwrit=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  2848.   END
  2849. IF toname='' THEN
  2850.   DO
  2851.     IF edtype='MAIL' THEN
  2852.       DO
  2853.         CALL selectchosen(1 pen3'Send PRIVATE' edtype lastwrit+1 'To: 'def)
  2854.         toname=thechosen.1
  2855.       END
  2856.     ELSE toname=getinput(1 0 pen3'Post A PUBLIC Message To: 'def)
  2857.   END
  2858. toname=SPACE(STRIP(UPPER(toname)),1,'_')
  2859. toname=COMPRESS(toname,'.,:/*#?^ ')
  2860. IF toname='' | FIND(exclusion,toname)>0 THEN
  2861.   DO
  2862.     IF toname='' & edtype='MSG' THEN toname='ALL'
  2863.     ELSE toname=sysop
  2864.     SAY pen3'*** Re-Addressed to'def toname
  2865.   END
  2866. IF toname~='ALL' THEN
  2867.   DO
  2868.     IF toname='BBBBS' THEN toname=sysop
  2869.     IF FIND(userlist,toname)=0 THEN
  2870.       DO
  2871.         IF courtesy='' THEN CALL loadcourtesy()
  2872.         IF FIND(courtesy,toname)=0 THEN
  2873.           DO
  2874.             SAY
  2875.             SAY bak2' 'toname' is not on the user list! 'def
  2876.             IF edtype='MAIL' THEN
  2877.               DO
  2878.                 CALL showuserlist()
  2879.                 RETURN 0
  2880.               END
  2881.             ELSE
  2882.               DO
  2883.                 IF getinput(1 1 'Do you want to use it anyway? (nY) > ')='N' THEN
  2884.                   DO
  2885.                     IF getinput(1 1 'Do you want to see the list of current users? (Ny) > ')='Y' THEN
  2886.                       CALL showuserlist()
  2887.                     RETURN 0
  2888.                   END
  2889.               END
  2890.           END
  2891.       END
  2892.   END
  2893. IF edtype='MAIL' THEN
  2894.   DO
  2895.     CALL MAKEDIR(bbspath'EMail/'toname)
  2896.     mailname=bbspath'EMail/'toname'/'name'.'lastwrit+1
  2897.   END
  2898. ELSE
  2899.   DO
  2900.     CALL MAKEDIR(msgpath||msgdir)
  2901.     mailname=msgpath||msgdir'/'lastwrit+1
  2902.   END
  2903. lynes.=''
  2904. lynes.0=6
  2905. IF edtype='MAIL' THEN lynes.1=' Mail:' lastwrit+1  /* FILE: filename */
  2906. ELSE lynes.1='  Msg:' lastwrit+1          /* Msg: MSG# REPLY # # ... */
  2907. lynes.2=' From:' name
  2908. IF city~='' THEN lynes.2=lynes.2' - 'city
  2909. lynes.3='   To:' toname                       /*  To: toname   MSG # */
  2910. IF edtype='MAIL' THEN
  2911.   DO
  2912.     IF readopen(bbspath||'Users/'toname) THEN
  2913.       DO
  2914.         CALL READLN(f)
  2915.         CALL READLN(f)
  2916.         temp=READLN(f)
  2917.         CALL CLOSE(f)
  2918.         temp=docity(temp)
  2919.         IF temp~='' THEN lynes.3=lynes.3' - 'temp
  2920.       END
  2921.     IF replysubj='|@NEW@|' THEN
  2922.       DO
  2923.         CALL readlines(bbspath'BBS_TEXT/EMAIL_WELCOME' 7)
  2924.         replysubj='Welcome to' bbsname
  2925.       END
  2926.   END
  2927. subj=''
  2928. IF edtype='REPLY' THEN
  2929.   DO
  2930.     subj=SUBSTR(forthline,WORDINDEX(forthline,2))
  2931.     SAY pen3'Subj:'def subj
  2932.     temp=getinput(0 0 'Change the current subject? (Ny) > ')
  2933.     IF LENGTH(temp)>3 THEN subj=temp
  2934.     ELSE IF LEFT(UPPER(temp),1)='Y' THEN subj=''
  2935.   END
  2936. ELSE IF edtype='MAIL' & replysubj~='' THEN subj=replysubj
  2937. IF subj='' THEN
  2938.   DO
  2939.     IF opt='C' THEN subj='FEEDBACK'
  2940.     ELSE
  2941.       DO
  2942.         SAY pen3'Enter the'def 'Subject' pen3'of this message (1 line).'def
  2943.         subj=getinput(0 0 pen3': 'def)
  2944.       END
  2945.   END
  2946. IF LENGTH(subj)>66 THEN subj=LEFT(subj,66)
  2947. IF subj='' THEN subj='?'
  2948. lynes.4=' Subj:' subj
  2949. lynes.5=' Date:' DATE('W') DATE()'  'TIME('C')
  2950. IF edtype~='MAIL' THEN lynes.5=LEFT(lynes.5,39) 'Conference:' msg.msgdir
  2951. lynes.6=INSERT('','',1,74,'=')
  2952. IF edtype='REPLY' THEN lynes.3=lynes.3'  MSG 'msgnum
  2953. DO i=1 TO lynes.0
  2954.   SAY lynes.i
  2955. END
  2956. CALL writebuffer(scratch'/MessageLOCAL')
  2957. IF savelines(mailname) THEN RETURN 0
  2958. CALL seelines(1)
  2959. IF thechosen.0='' THEN
  2960.   DO
  2961.     thechosen.0=1
  2962.     thechosen.1=toname
  2963.   END
  2964. carbons=thechosen.0+1
  2965. DO FOREVER
  2966.   IF thechosen.0>=carbons THEN
  2967.     DO
  2968.       junk='Copies To:'
  2969.       DO cci=carbons TO thechosen.0
  2970.         junk=junk thechosen.cci
  2971.       END
  2972.       SAY junk
  2973.     END
  2974.   pline=''
  2975.   IF edtype='MAIL' THEN pline='['pen3'C'def']opies'
  2976.   pline=STRIP(pline '['pen3'E'def']dit ['pen3'K'def']ill ['pen3'R'def']ead')
  2977.   pline=pline '['pen3'U'def']pload-Text ['pen3'S'def']end' edtype'? (ekrSu) 'def
  2978.   junk=getinput(1 1 pline)
  2979.   IF junk='E' THEN
  2980.     DO
  2981.       IF level>sysoplevel THEN firstedit=1
  2982.       ELSE firstedit=7
  2983.       IF bbsED(firstedit mailname)=2 THEN RETURN 0
  2984.       junk='R'
  2985.     END
  2986.   ELSE IF edtype='MAIL' & junk='C' THEN
  2987.     DO
  2988.       CALL selectchosen(carbons pen3'Carbon Copies To: 'def)
  2989.       junk='R'
  2990.     END
  2991.   ELSE IF junk='K' THEN
  2992.     DO
  2993.       IF DELETE(mailname)=1 THEN SAY edtype 'DELETED.'
  2994.       RETURN 0
  2995.     END
  2996.   ELSE IF junk='U' THEN
  2997.     DO
  2998.       SAY 'Ready to append' pen3'TEXT ONLY'def
  2999.       pline='Are you SURE your file is un-compressed text? (Ny) > '
  3000.       IF getinput(1 1 pline)='Y' THEN
  3001.         DO
  3002.           arg='UploadLOCAL'
  3003.           curdir=PRAGMA('D')
  3004.           CALL setdir(scratch)
  3005.           CALL DELETE(arg)
  3006.           CALL DELETE('tempLOCAL')
  3007.           IF uload(0)=0 THEN
  3008.             DO
  3009.               ADDRESS COMMAND 'C:copy' mailname 'tempLOCAL'
  3010.               CALL DELETE(mailname)
  3011.               ADDRESS COMMAND 'C:join tempLOCAL UploadLOCAL AS' mailname
  3012.             END
  3013.           CALL setdir(curdir)
  3014.         END
  3015.       junk='R'
  3016.     END
  3017.   IF junk='R' THEN
  3018.     DO
  3019.       CALL readlines(mailname 1)
  3020.       CALL seelines(1)
  3021.       nonstop=0
  3022.     END
  3023.   ELSE BREAK
  3024. END
  3025. IF edtype='MAIL' THEN
  3026.   DO
  3027.     IF replysubj~='' & readname~='' & LEFT(readname,5)~='BBBBS' & uname~='' & uname~='UNAME' THEN
  3028.       DO
  3029.         junk=getinput(1 1 'Attach original mail from' uname'? (nY) > ')
  3030.         IF junk~='N' THEN
  3031.           DO
  3032.             arg=bbspath'Email/'name'/'readname
  3033.             IF ~readlines(arg 1) THEN CALL savelines(mailname)
  3034.           END
  3035.       END
  3036.     junk=getinput(1 1 pen3'Attach a file to this message? (Ny) > 'def)
  3037.     IF junk='Y' THEN
  3038.       DO
  3039.         savearg=arg
  3040.         arg=getinput(0 0 'Filename: ')
  3041.         curdir=PRAGMA('D')
  3042.         CALL MAKEDIR(bbspath'EmailFiles/'toname)
  3043.         CALL setdir(bbspath'EmailFiles/'toname)
  3044.         IF uload(0)=0 & WORD(STATEF(bbspath'EmailFiles/'toname'/'arg),2)>1 THEN
  3045.           DO
  3046.             CALL readlines(mailname 1)
  3047.             IF arg~='' THEN lynes.1=lynes.1'  FILE: 'arg
  3048.             CALL setdir(curdir)
  3049.             CALL DELETE(mailname)
  3050.             CALL savelines(mailname)
  3051.           END
  3052.         ELSE
  3053.           DO
  3054.             CALL DELETE(bbspath'EmailFiles/'toname'/'arg)
  3055.             SAY pen3'*** Upload failed! ***'def
  3056.           END
  3057.         arg=savearg
  3058.       END
  3059.     totmail=WORD(data.17,2)
  3060.     IF ~DATATYPE(totmail,'W') THEN totmail=1
  3061.     ELSE totmail=totmail+1
  3062.     data.17=WORD(data.17,1)'  'totmail'  'WORD(data.17,3)
  3063.   END
  3064. IF edtype~='MAIL' THEN totwrit.msgdir=totwrit.msgdir+1
  3065. CALL readlines(mailname 1)
  3066. DO ui=1 TO thechosen.0
  3067.   IF thechosen.ui='' THEN ITERATE ui
  3068.   IF ui>1 THEN
  3069.     DO
  3070.       CALL MAKEDIR(bbspath'Email/'thechosen.ui)
  3071.       newname=bbspath'Email/'thechosen.ui'/'name'.'lastwrit+1
  3072.       IF ui<carbons THEN lynes.3='   To:' thechosen.ui
  3073.       ELSE
  3074.         DO
  3075.           lynes.1=lynes.1'  (Carbon Copy)'
  3076.           lynes.3='   To:' thechosen.1
  3077.         END
  3078.       CALL savelines(newname)
  3079.       IF WORDS(lynes.1)>3 & EXISTS(bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4)) THEN
  3080.         DO
  3081.           CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ui)
  3082.           ADDRESS COMMAND 'C:COPY' bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.1,4) bbspath'EmailFiles/'thechosen.ui
  3083.           line2='Copied' WORD(lynes.1,4)
  3084.           SAY line2 'to the' thechosen.ui 'file area.'
  3085.         END
  3086.     END
  3087.   IF edtype~='MAIL' THEN
  3088.     DO
  3089.       IF FIND(userlist,thechosen.ui)>0 THEN
  3090.         CALL msgmark(thechosen.ui msgdir lastwrit+1)
  3091.     END
  3092.   IF GETCLIP('BBS_level')~='' & WORD(GETCLIP('BBS_lastcaller'),1)=thechosen.ui THEN
  3093.     DO
  3094.       temp='new Email.'
  3095.       IF edtype~='MAIL' THEN
  3096.         temp='a new message addressed to you in the'pen3 msg.msgdir def'conference.'
  3097.       oldmess=GETCLIP('BBS_MESSAGE')
  3098.       IF oldmess~='' THEN oldmess=oldmess||'0D0A'x
  3099.       CALL SETCLIP('BBS_MESSAGE',oldmess||'You have' temp)
  3100.     END
  3101.   line=edtype 'Sent To' thechosen.ui
  3102.   IF edtype='MAIL' THEN
  3103.     DO
  3104.       IF emailonline>=0 THEN emailonline=emailonline+1
  3105.     END
  3106.   ELSE
  3107.     DO
  3108.       grand=grand+1
  3109.       IF ~DATATYPE(msg.msgdir.0,'W') THEN msg.msgdir.0=1
  3110.       ELSE msg.msgdir.0=msg.msgdir.0+1
  3111.       line=line 'in the'pen3 msg.msgdir def'conference.'
  3112.     END
  3113.   SAY line
  3114. END
  3115. IF edtype='MAIL' THEN CALL countcheck(bbspath'Numbers/LastMail' lastwrit+1)
  3116. ELSE CALL countcheck(bbspath'Numbers/LastMessage'msgdir lastwrit+1)
  3117. CALL setdir(libpath||dirs.1)
  3118. thechosen.=''
  3119. RETURN 1
  3120.  
  3121.  
  3122. msgmark:
  3123. PARSE ARG markname markdir markmsg .
  3124. IF OPEN(f,bbspath'Users/'markname)=0 THEN RETURN
  3125. mlines.=''
  3126. DO mi=1 TO 24
  3127.   mlines.mi=READLN(f)
  3128. END
  3129. mlines.24=STRIP(mlines.24 markdir'/'markmsg)
  3130. CALL SEEK(f,0,'B')
  3131. DO mi=1 TO 24
  3132.   CALL WRITELN(f,mlines.mi)
  3133. END
  3134. CALL CLOSE(f)
  3135. RETURN
  3136.  
  3137.  
  3138. shell:
  3139. SAY
  3140. olddir=PRAGMA('D')
  3141. DO WHILE(UPPER(opt)~='EXIT')
  3142.   SAY bak2||TIME('C')||def PRAGMA('D')
  3143.   OPTIONS PROMPT pen3'Type EXIT to quit AmigaDOS> 'def
  3144.   PARSE PULL opt' 'arg
  3145.   IF(UPPER(opt)='CD') THEN CALL setdir(arg)
  3146.   ELSE IF exists(opt)~=0 THEN
  3147.     DO
  3148.       IF LEFT(STATEF(opt),3)='DIR' THEN CALL setdir(opt)
  3149.     END
  3150.   ELSE IF opt~='' & UPPER(opt)~='EXIT' THEN
  3151.     ADDRESS COMMAND opt '<* >*' arg
  3152. END
  3153. CALL PRAGMA('D',olddir)
  3154. RETURN
  3155.  
  3156.  
  3157. bbsspace:
  3158. ARG tabspace .
  3159. ADDRESS COMMAND 'C:info >ram:locinfout' bbsdevice
  3160. ok=OPEN(f,'ram:locinfout','R')
  3161. IF ok=0 THEN RETURN 20
  3162. line=READLN(f)
  3163. line=READLN(f)
  3164. line=READLN(f)
  3165. line=READLN(f)
  3166. CALL CLOSE(f)
  3167. IF tabspace<14 THEN SAY 
  3168. bbsk=WORD(line,4)
  3169. IF ~DATATYPE(bbsk,'N') THEN
  3170.   DO
  3171.     line=bbsdevice 'is not an info compatible device!'
  3172.     SAY pen3||line||def
  3173.     bbsk=0
  3174.     RETURN
  3175.   END
  3176. bbsk=bbsk*512-SYSTEM_SPACE_LIMIT
  3177. IF bbsk<1 THEN bbsk=0
  3178. SAY RIGHT(comma(bbsk),tabspace) 'bytes available for uploads.'
  3179. RETURN
  3180.  
  3181.  
  3182. comma:
  3183. ARG num .
  3184. dgt=LENGTH(num)
  3185. numtext=''
  3186. IF dgt>3 THEN numtext=','RIGHT(num,3)
  3187. IF dgt>6 THEN numtext=','LEFT(RIGHT(num,6),3)||numtext
  3188. IF dgt>9 THEN numtext=','LEFT(RIGHT(num,9),3)||numtext
  3189. IF dgt>12 THEN
  3190.   DO
  3191.     numtext=','LEFT(RIGHT(num,12),3)||numtext
  3192.     numtext=LEFT(num,dgt-12)||numtext
  3193.   END
  3194. ELSE IF dgt>9 THEN numtext=LEFT(num,dgt-9)||numtext
  3195. ELSE IF dgt>6 THEN numtext=LEFT(num,dgt-6)||numtext
  3196. ELSE IF dgt>3 THEN numtext=LEFT(num,dgt-3)||numtext
  3197. ELSE numtext=num
  3198. RETURN numtext
  3199.  
  3200.  
  3201. is_here:
  3202. ARG newname 
  3203. SAY 'Checking filelist...'
  3204. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3205. DO ui=1 TO filenum
  3206.   IF UPPER(WORD(files.ui,2))~=newname THEN ITERATE ui
  3207.   temp=WORD(files.ui,1)
  3208.   line=pen3'*** File' newname 'already exists here in the'
  3209.   line=line temp 'directory.'def
  3210.   SAY line
  3211.   temp=files.ui.0
  3212.   IF DATATYPE(temp,'W') THEN SAY alpha.temp
  3213.   SAY 'Original uploader should ['pen3'K'def']ill the file before uploading the replacement.'
  3214.   RETURN 1
  3215. END
  3216. CALL cleanline(1)
  3217. RETURN 0
  3218.  
  3219.  
  3220. uload:
  3221. ARG frommenu
  3222. CALL bbsspace(12)
  3223. SAY
  3224. IF bbsk<1 THEN
  3225.   DO
  3226.     SAY pen3'Upload area is full!'def
  3227.     RETURN 1
  3228.   END
  3229. IF arg='' THEN arg=getinput(0 0 'Filename: ')  /* no filename given */
  3230. arg=COMPRESS(arg,' :/,;|#?*')  /* be sure no illegals here */
  3231. tempnum=LENGTH(arg)-16
  3232. DO WHILE tempnum>0
  3233.   temp='          'pen3||arg def'is'pen3 tempnum||def
  3234.   IF tempnum=1 THEN temp=temp 'character'
  3235.   ELSE temp=temp 'characters'
  3236.   temp=temp 'too long for a filename.'
  3237.   SAY temp  
  3238.   arg=getinput(0 0 'Filename: ')
  3239.   arg=cleanstring('0:'arg)
  3240.   arg=COMPRESS(arg,' :/,;|#?*')
  3241.   tempnum=LENGTH(arg)-16
  3242. END
  3243. IF arg='' THEN RETURN 1
  3244. IF frommenu THEN
  3245.   DO
  3246.     IF is_here(arg) THEN RETURN 1
  3247.     IF bbsprefs.6=1 & sysoplevel>level THEN CALL setdir(libpath'Sysops')
  3248.     ELSE
  3249.       DO loop=1
  3250.         SAY 'Please select an appropriate library for -' pen3||arg def'-'
  3251.         IF chdir()=0 THEN LEAVE loop
  3252.       END
  3253.   END
  3254. SAY ' Select File to Copy To' plaindir'/'arg
  3255. frompath=GETCLIP('BBS_frompath')
  3256. IF frompath='' THEN frompath=libpath'SysOps'
  3257. fromfile=GetFile(150,36,frompath,arg,' Select File to Copy ')
  3258. IF fromfile='' THEN RETURN 1
  3259. CALL SETCLIP('BBS_frompath',WORD(lastslash(fromfile),2))
  3260. ADDRESS COMMAND 'C:Copy' fromfile PRAGMA('D')'/'arg
  3261. IF TestArc.rexx(PRAGMA('D')'/'arg)>0 THEN
  3262.   DO
  3263.     SAY
  3264.     SAY pen3'***'def arg pen3'failed archive check!'def
  3265.     SAY
  3266.     temp=getinput(1 1 'Do you believe the archive checker made a mistake? (Ny) > ')
  3267.     IF temp~='Y' THEN
  3268.       DO
  3269.         CALL DELETE(arg)
  3270.         SAY CR
  3271.         RETURN 2
  3272.       END
  3273.   END
  3274. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN 0
  3275. DO ui=sysoplevel+2 TO 100
  3276.   IF UPPER(dirs.ui)=UPPER(plaindir) THEN RETURN 0
  3277. END
  3278. IF frommenu THEN
  3279.   DO WHILE editnote(bbspath'FileNotes/'plaindir'/'arg) /* INSIST on a filenote */
  3280.   END
  3281. RETURN 0
  3282.  
  3283.  
  3284. findfiles:
  3285. PARSE ARG ffile .
  3286. IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN RETURN ffile
  3287. IF DATATYPE(ffile,'W') THEN
  3288.   DO
  3289.     IF WORDS(files.ffile)<2 THEN RETURN 0
  3290.     dirtemp=WORD(files.ffile,1)
  3291.     IF finddirnum(dirtemp)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3292.       DO
  3293.         CALL illegal_access()
  3294.         RETURN 0
  3295.       END
  3296.     CALL setdir(libpath||dirtemp)
  3297.   END
  3298. ELSE IF EXISTS(ffile) THEN
  3299.   DO
  3300.     IF EXISTS(bbspath'FileNotes/'plaindir'/'ffile) THEN
  3301.       DO
  3302.         IF readopen(bbspath'FileNotes/'plaindir'/'ffile)~=0 THEN
  3303.           DO
  3304.             line=READLN(f)
  3305.             CALL CLOSE(f)
  3306.             ffile=WORD(line,2)
  3307.           END
  3308.       END
  3309.   END
  3310. ELSE
  3311.   DO
  3312.     nextfilenum=countcheck(bbspath'Numbers/LastFile' 0)+1
  3313.     DO ui=nextfilenum TO 0 BY -1
  3314.       IF ui<1 THEN
  3315.         DO
  3316.           SAY '***' files.0 'filenames scanned,'pen3 ffile def'was not found!'
  3317.           RETURN 0
  3318.         END
  3319.       argtemp=WORD(files.ui,2)
  3320.       IF UPPER(argtemp)=UPPER(ffile) THEN
  3321.         DO
  3322.           dirtemp=WORD(files.ui,1)
  3323.           jj=files.ui.0
  3324.           IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(dirtemp))>0 THEN
  3325.             DO
  3326.               CALL illegal_access()
  3327.               RETURN 0
  3328.             END
  3329.           ffile=ui
  3330.           CALL setdir(libpath||dirtemp)
  3331.           LEAVE ui
  3332.         END
  3333.     END
  3334.   END
  3335. ftemp=ffile
  3336. IF DATATYPE(ftemp,'W') THEN ftemp=WORD(files.ftemp,2)
  3337. IF ~EXISTS(ftemp) THEN
  3338.   DO
  3339.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'ftemp)
  3340.     IF WORDS(finfo)>7 THEN ftemp=WORD(finfo,8)
  3341.     IF ~EXISTS(ftemp) THEN
  3342.       DO
  3343.         IF finfo='' THEN SAY '***'pen3 PRAGMA('D')'/'ftemp def'was not found!'
  3344.         ELSE
  3345.           DO
  3346.             SAY
  3347.             SAY '***'pen3 plaindir'/'ftemp def'is not currently available online.'
  3348.             SAY 'Please leave email to your sysop'pen3 sysop||def', to receive this file.'
  3349.             SAY
  3350.           END
  3351.         RETURN 0
  3352.       END
  3353.   END
  3354. RETURN ffile
  3355.  
  3356.  
  3357. illegal_access:
  3358. SAY
  3359. SAY '*** You are not authorized to access' ffile'!'
  3360. SAY '*** Send Email to' sysop 'to receive a higher level.'
  3361. SAY
  3362. RETURN
  3363.  
  3364.  
  3365. ext_dload:
  3366. SAY
  3367. arg=bbsExtDL.baud(name level TRUNC(maxtime-TIME('E')) linesperpage colorflag extdevs)
  3368. IF arg~='' THEN SAY 'Sorry, LOCAL mode cannot download from the Extra Devices.'
  3369. RETURN
  3370.  
  3371.  
  3372. dload:
  3373. arg=STRIP(arg data.25)
  3374. data.25=''
  3375. errorflag=0
  3376. curdir=PRAGMA('D')
  3377. OPTIONS PROMPT 'Filename and/or number: '
  3378. IF arg='' THEN PARSE PULL arg  /* no filename given */
  3379. IF arg='' THEN RETURN 0
  3380. IF findfiles(arg)=0 THEN RETURN 0
  3381. arg=TRANSLATE(arg,'  ',':/')
  3382. IF WORDS(arg)>1 THEN arg=WORD(arg,1)
  3383. IF arg~='' THEN           /* check for filename */
  3384.   DO dloadloop=1
  3385.     frompath=GETCLIP('BBS_frompath')
  3386.     IF frompath='' THEN frompath=libpath'SysOps/'
  3387.     notename=bbspath'FileNotes/'plaindir'/'arg
  3388.     IF ~EXISTS(arg) THEN
  3389.       DO
  3390.         finfo=STATEF(notename)
  3391.         IF WORDS(finfo)>7 THEN
  3392.           DO
  3393.             temp=plaindir
  3394.             x=lastslash(WORD(finfo,8))
  3395.             arg=WORD(x,1)
  3396.             CALL setdir(WORD(x,2))
  3397.             plaindir=temp
  3398.           END
  3399.       END
  3400.     topath=PRAGMA('D')
  3401.     num=LASTPOS('/',arg)
  3402.     IF num=0 THEN num=LASTPOS(':',arg)
  3403.     IF num>0 THEN
  3404.       DO
  3405.         topath=LEFT(arg,num)
  3406.         arg=SUBSTR(arg,num+1)
  3407.       END
  3408.     IF RIGHT(topath,1)~=':' & RIGHT(topath,1)~='/' THEN topath=topath'/'
  3409.     SAY ' Select Filename to Copy ' topath||arg 'To:'
  3410.     tofile=GetFile(150,36,frompath,arg,' Select Destination Name ')
  3411.     IF tofile='' THEN
  3412.       DO
  3413.         errorflag=1
  3414.         LEAVE dloadloop
  3415.       END
  3416.     ADDRESS COMMAND 'C:Copy' topath||arg tofile
  3417.     CALL SETCLIP('BBS_frompath',WORD(lastslash(tofile),2))
  3418.     IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN LEAVE dloadloop
  3419.     DO di=sysoplevel+2 TO 100
  3420.       IF UPPER(dirs.di)=UPPER(plaindir) THEN LEAVE dloadloop
  3421.     END
  3422.     IF readlines(notename 1) THEN LEAVE dloadloop
  3423.     dls=WORD(lynes.2,7)
  3424.     IF ~DATATYPE(dls,'W') THEN dls=0
  3425.     lynes.2=STRIP(DELWORD(lynes.2,7,1)) dls+1
  3426.     finfo=STATEF(notename)
  3427.     IF WORDS(finfo)>7 THEN finfo=SUBSTR(finfo,WORDINDEX(finfo,8))
  3428.     ELSE finfo=''
  3429.     CALL DELETE(notename)
  3430.     CALL savelines(notename)
  3431.     CALL DELAY(28)
  3432.     IF finfo~='' THEN ADDRESS COMMAND 'C:FileNote' notename finfo
  3433.     LEAVE dloadloop
  3434.   END
  3435. CALL setdir(curdir)
  3436. IF errorflag THEN SAY pen3'*** Download Failed!'def
  3437. RETURN errorflag
  3438.  
  3439.  
  3440. lastslash:
  3441. PARSE ARG sarg 
  3442. sdir=''
  3443. slash=LASTPOS('/',sarg)
  3444. IF slash>2 THEN sdir=LEFT(sarg,slash-1)
  3445. ELSE
  3446.   DO
  3447.     slash=LASTPOS(':',sarg)
  3448.     IF slash>0 THEN sdir=LEFT(sarg,slash)
  3449.   END
  3450. IF slash>0 THEN sarg=SUBSTR(sarg,slash+1)
  3451. RETURN sarg sdir
  3452.  
  3453.  
  3454. editnote:
  3455. IF arg='' THEN
  3456.   DO
  3457.     PARSE PULL arg .
  3458.     IF arg='' THEN RETURN 0
  3459.   END
  3460. comment=''
  3461. IF ~EXISTS(arg) THEN
  3462.   DO
  3463.     finfo=STATEF(bbspath'FileNotes/'plaindir'/'arg)
  3464.     fromarg=arg
  3465.     fromdir=GETCLIP('BBS_frompath')
  3466.     IF WORDS(finfo)>7 THEN
  3467.       DO
  3468.         temp='Y'
  3469.         fromdir=WORD(finfo,8)
  3470.         fromdir=lastslash(fromdir)
  3471.         fromarg=WORD(fromdir,1)
  3472.         fromdir=WORD(fromdir,2)
  3473.       END
  3474.     ELSE
  3475.       DO
  3476.         IF level<sysoplevel THEN RETURN 0
  3477.         temp=getinput(1 1 'Is this file on an another device? (Nqy)')
  3478.       END
  3479.     IF fromdir='' THEN fromdir=libpath'Sysops'
  3480.     IF temp='Y' THEN
  3481.       DO WHILE comment=''
  3482.         comment=GetFile(150,36,fromdir,fromarg,' Select Linked File ')
  3483.         IF comment='' THEN RETURN 0
  3484.         IF ~EXISTS(comment) THEN comment=''
  3485.         ELSE CALL SETCLIP('BBS_frompath',WORD(lastslash(comment),2))
  3486.       END
  3487.     ELSE IF temp~='N' THEN RETURN 0
  3488.   END
  3489. IF comment='' THEN
  3490.   DO
  3491.     arg=findfiles(arg)
  3492.     IF arg=0 THEN RETURN 0
  3493.     IF DATATYPE(arg,'W') THEN arg=WORD(files.arg,2)
  3494.   END
  3495. filedir=plaindir
  3496. slash=LASTPOS('/',arg)
  3497. IF slash=0 THEN slash=LASTPOS(':',arg)
  3498. IF slash>0 THEN
  3499.   DO
  3500.     filedir=LEFT(arg,slash-1)
  3501.     filedir=SUBSTR(filedir,5)
  3502.     arg=SUBSTR(arg,slash+1)
  3503.   END
  3504. ELSE filedir=plaindir
  3505. CALL MAKEDIR(bbspath'FileNotes/'filedir)
  3506. IF ~EXISTS(bbspath'FileNotes/'filedir) THEN
  3507.   DO
  3508.     SAY pen3'*** Failed to open directory!' filedir||def
  3509.     RETURN 0
  3510.   END
  3511. notename=bbspath'FileNotes/'filedir'/'arg
  3512. lynes.=''
  3513. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3514. IF level>sysoplevel THEN firstedit=1
  3515. ELSE firstedit=5
  3516. IF EXISTS(notename) THEN
  3517.   DO
  3518.     IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3519.     CALL bbsED(firstedit notename)
  3520.     RETURN 0
  3521.   END
  3522. IF comment='' THEN filedata=STATEF(libpath||filedir'/'arg)
  3523. ELSE filedata=STATEF(comment)
  3524. IF filedata='' THEN
  3525.   DO
  3526.     IF comment='' THEN line=filedir'/'arg
  3527.     ELSE line=comment
  3528.     SAY line 'does not exist!'
  3529.     RETURN 0
  3530.   END
  3531. bytes=WORD(filedata,2)
  3532. filenum=filenum+1
  3533. lynes.0=4
  3534. lynes.1='File: 'LEFT(filenum,5)' KeyWords:'
  3535. lynes.2='Name: 'LEFT(arg,27)' Size: 'bytes' bytes   Downloads: 0'
  3536. lynes.3='From: 'LEFT(name,27)' Date: 'DATE() TIME('C')'  Lib: 'filedir
  3537. lynes.4=INSERT('','',1,74,'=')
  3538. lynes.1=lynes.1 edkeywords(arg filedir)
  3539. CALL seelines(1)
  3540. edtype=''
  3541. CALL writebuffer(scratch'/NoteLOCAL')
  3542. IF savelines(notename) THEN RETURN 0
  3543. IF comment~='' THEN ADDRESS COMMAND 'C:filenote' notename comment
  3544. fncom='R'
  3545. DO WHILE fncom='R'
  3546.   CALL seelines(1)
  3547.   nonstop=0
  3548.   line='['pen3'E'def']dit'
  3549.   IF level>sysoplevel THEN line=line '['pen3'K'def']ill'
  3550.   line=line '['pen3'R'def']ead ['pen3'S'def']ave'
  3551.   IF level>sysoplevel THEN line=line '(ekrS) 'def
  3552.   ELSE line=line '(erS) 'def
  3553.   fncom=getinput(1 1 line)
  3554.   IF fncom='K' & level>sysoplevel THEN
  3555.     DO
  3556.       SAY 'Killing FileNote..'
  3557.       CALL DELETE(notename)
  3558.       RETURN 1
  3559.     END
  3560.   ELSE IF fncom='E' THEN
  3561.     DO
  3562.       IF bbsED(firstedit notename)>0 THEN RETURN 0
  3563.       fncom='R'
  3564.     END
  3565.   ELSE IF fncom~='R' THEN
  3566.     DO
  3567.       SAY 'Adjusting filelist...'
  3568.       IF filenum<1 THEN filenum=1
  3569.       IF GETCLIP('BBS_level')~='' THEN CALL SETCLIP('BBS_localfiles',1)
  3570.       CALL countcheck(bbspath'Numbers/LastFile' filenum)
  3571.       files.0=files.0+1
  3572.       newcount=alpha.0+1
  3573.       alpha.0=newcount
  3574.       files.filenum=plaindir arg
  3575.       files.filenum.0=newcount
  3576.       libnum=finddirnum(plaindir)
  3577.       PARSE VAR lynes.1 . 'KeyWords:' keywords
  3578.       alpha.newcount=LEFT(arg,22-LENGTH(WORD(lynes.2,4)))
  3579.       alpha.newcount=alpha.newcount WORD(lynes.2,4) RIGHT(filenum,5)
  3580.       alpha.newcount=alpha.newcount RIGHT(libnum,2) LEFT(plaindir,12)
  3581.       alpha.newcount=alpha.newcount STRIP(LEFT(STRIP(keywords),32))
  3582.       IF EXISTS(bbspath'Lists/Files') THEN
  3583.         x=OPEN(f,bbspath'Lists/Files','A')
  3584.       ELSE x=OPEN(f,bbspath'Lists/Files','W')
  3585.       IF x=0 THEN
  3586.         DO
  3587.           SAY '*** Failed to open' bbspath'Lists/Files'
  3588.           RETURN 0
  3589.         END
  3590.       CALL WRITELN(f,filenum files.filenum)
  3591.       CALL CLOSE(f)
  3592.       IF EXISTS(bbspath'Lists/Files.ALPHA') THEN
  3593.         x=OPEN(f,bbspath'Lists/Files.ALPHA','A')
  3594.       ELSE x=OPEN(f,bbspath'Lists/Files.ALPHA','W')
  3595.       IF x=0 THEN
  3596.         DO
  3597.           SAY '*** Failed to open' bbspath'Lists/Files.ALPHA'
  3598.           RETURN 0
  3599.         END
  3600.       CALL WRITELN(f,alpha.newcount)
  3601.       CALL CLOSE(f)
  3602.       sortalphaflag=1
  3603.       savefileflag=1
  3604.     END
  3605. END
  3606. RETURN 0
  3607.  
  3608.  
  3609. edkeywords:
  3610. PARSE ARG kwarg
  3611. SAY
  3612. SAY pen3'Please enter a list of keywords (or a condensed description)'def
  3613. SAY pen3'to be used in the alphabetic list and by the search routine.'def
  3614. SAY '    Note that only the first 32 characters will be used.'
  3615. SAY INSERT('','',1,74,'=')
  3616. templine=getinput(0 0 ' 'RIGHT(STRIP(RIGHT(kwarg,32)),32) pen3'KeyWords: 'def)
  3617. SAY
  3618. RETURN STRIP(LEFT(templine,32))
  3619.  
  3620.  
  3621. loadfiles:
  3622. SAY def
  3623. SAY 'Loading filelist...'
  3624. files.=''
  3625. files.0=0
  3626. IF readopen(bbspath'Lists/Files') THEN
  3627.   DO
  3628.     DO i=1
  3629.       line=READLN(f)
  3630.       IF EOF(f) THEN BREAK
  3631.       num=WORD(line,1)
  3632.       IF DATATYPE(num,'W') THEN files.num=WORD(line,2) WORD(line,3)
  3633.     END
  3634.     files.0=i-1
  3635.     CALL CLOSE(f)
  3636.   END
  3637. RETURN
  3638.  
  3639.  
  3640. savefilelist:
  3641. IF level=99 THEN
  3642.   IF getinput(1 1 'Update filelists now? (nY) > ')='N' THEN RETURN
  3643.  
  3644. savefilelist2:
  3645. SIGNAL OFF BREAK_E
  3646. IF ckmaint('FILES') THEN RETURN
  3647. CALL savealphalist()
  3648. SAY 'Saving filelist...'
  3649. CALL SETCLIP('BBS_maint',1)
  3650. xarg=bbspath'Lists/Files'
  3651. CALL DELETE(xarg)
  3652. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  3653. IF filenum<1 | writeopen(xarg)=0 THEN RETURN
  3654. DO i=1 TO filenum
  3655.   IF files.i='' THEN ITERATE
  3656.   CALL WRITELN(f,i files.i)
  3657. END
  3658. CALL CLOSE(f)
  3659. CALL SETCLIP('BBS_maint')
  3660. savefileflag=0
  3661. IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  3662. RETURN
  3663.  
  3664.  
  3665. loadalpha:
  3666. SAY def
  3667. SAY 'Loading the alphabetical filelist...'
  3668. IF readopen(bbspath'Lists/Files.ALPHA') THEN
  3669.   DO
  3670.     alpha.=''
  3671.     alpha.0=0
  3672.     DO i=1
  3673.       line=READLN(f)
  3674.       IF EOF(f) THEN BREAK
  3675.       fnum=WORD(line,3)
  3676.       IF DATATYPE(fnum,'W') THEN
  3677.         DO
  3678.           alpha.i=line
  3679.           files.fnum.0=i
  3680.         END
  3681.       ELSE i=i-1
  3682.     END
  3683.     CALL CLOSE(f)
  3684.     alpha.0=i-1
  3685.   END
  3686. ELSE SAY pen3'*** Lists/Files.ALPHA failed to open for reading!'def
  3687. SAY
  3688. RETURN
  3689.  
  3690.  
  3691. ckmaint:
  3692. ARG ckfile .
  3693. IF GETCLIP('BBS_maint')~='' THEN
  3694.   DO
  3695.     DO i=0 TO 23 WHILE GETCLIP('BBS_maint')~=''
  3696.       IF i//2=0 THEN SAY 'Waiting' (24-i)*5 'more seconds for' ckfile 'list update to finish...'
  3697.       CALL DELAY(250)
  3698.     END
  3699.     IF i>23 THEN
  3700.       DO
  3701.         SAY '*** unable to update' ckfile 'list.'
  3702.         RETURN 1
  3703.       END
  3704.   END
  3705. RETURN 0
  3706.  
  3707.  
  3708. savealphalist:
  3709. SIGNAL OFF BREAK_E
  3710. IF ckmaint('ALPHA') THEN RETURN
  3711. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  3712.   DO
  3713.     CALL SETCLIP('BBS_mainfiles')
  3714.     CALL loadfiles()
  3715.     CALL loadalpha()
  3716.   END
  3717. CALL SETCLIP('BBS_maint',1)
  3718. aarg=bbspath'Lists/Files.ALPHA'
  3719. CALL DELETE(aarg)
  3720. IF sortalphaflag=1 THEN
  3721.   DO
  3722.     SAY 'Alphabetizing' alpha.0 'files...'
  3723.     CALL QSORT(1,alpha.0,alpha)
  3724.     DO i=1 TO alpha.0
  3725.       fnum=WORD(alpha.i,3)
  3726.       files.fnum.0=i
  3727.     END
  3728.   END
  3729. sortalphaflag=0
  3730. IF writeopen(aarg)=0 THEN
  3731.   DO
  3732.     SAY '*** Error opening' aarg '!'
  3733.     RETURN
  3734.   END
  3735. SAY 'Saving alphabetical filelist...'
  3736. DO i=1 TO alpha.0
  3737.   ii=WORD(alpha.i,3)
  3738.   IF files.ii='' THEN alpha.i='0 0' ii '100'
  3739.   IF LEFT(alpha.i,4)~='0 0 ' THEN CALL WRITELN(f,alpha.i)
  3740. END
  3741. CALL CLOSE(f)
  3742. CALL SETCLIP('BBS_maint')
  3743. CALL bbsALPHA.rexx SUBSTR(extension,2) arccom
  3744. RETURN
  3745.  
  3746.  
  3747. viewuser:
  3748. SAY 
  3749. SAY bak2' 'name' 'def
  3750. DO i=1 TO 18
  3751.   stuff=data.i
  3752.   IF i=13 | i=14 THEN stuff=DATE(,data.i,'S')
  3753.   SAY RIGHT(i,2)||pen3 text.i||def':' stuff
  3754. END
  3755. CALL waiting()
  3756. RETURN
  3757.  
  3758.  
  3759. edituser:
  3760. IF getinput(1 1 'Change ['pen3'U'def']ser data or ['pen3'M'def']essage conference access (mU) > ')='M' THEN
  3761.   DO
  3762.     SAY
  3763.     SAY pen3'     - Message Conference Access -'def
  3764.     SAY '[O]ff turns all message conferences OFF.'
  3765.     SAY 'Set the last message read by you in ALL message conferences'
  3766.     temp=getinput(1 1 ' ['pen3'L'def']ast  ['pen3'F'def']irst  ['pen3'O'def']ff  ['pen3'Q'def']uit  (fLoq) > ')
  3767.     IF temp='Q' THEN RETURN
  3768.     SAY 'Resetting...'lineup
  3769.     data.22=''
  3770.     DO i=1 TO level
  3771.       IF temp='F' THEN num=0
  3772.       ELSE IF temp='O' THEN num=-1
  3773.       ELSE num=countcheck(bbspath'Numbers/LastMessage'i 0)
  3774.       data.22=data.22 num
  3775.     END
  3776.     CALL SetData()
  3777.     CALL sortconferences()
  3778.     CALL savedata(1)
  3779.     RETURN
  3780.   END
  3781. new=0
  3782. change=0
  3783. edata.=''
  3784. edname=name
  3785. DO i=0 TO data.0
  3786.   edata.i=data.i
  3787. END
  3788. num=1
  3789. DO WHILE num~='' | edname~=name
  3790.   IF num='' THEN
  3791.     DO
  3792.       IF change THEN
  3793.         DO
  3794.           CALL SetData()
  3795.           CALL saveData(1)
  3796.           change=0
  3797.         END
  3798.       IF new THEN
  3799.         DO
  3800.           data.=''
  3801.           DO i=0 TO edata.0
  3802.             data.i=edata.i
  3803.           END
  3804.           name=edname
  3805.           new=0
  3806.         END
  3807.       CALL SetData()
  3808.     END
  3809.   maxnum=10
  3810.   IF edata.20>sysoplevel THEN maxnum=20
  3811.   IF edata.20=99 THEN maxnum=24
  3812.   SAY bak2' 'name' 'def
  3813.   maxlines=21
  3814.   IF maxnum=10 THEN maxlines=20
  3815.   DO i=1 TO maxlines
  3816.     IF i=5 & name~=edname & edata.20<99 THEN ITERATE
  3817.     SAY RIGHT(i,2)||pen3 text.i||def':' data.i
  3818.   END
  3819.   IF edata.20>sysoplevel THEN
  3820.     DO
  3821.       line=LEFT(' ',50)
  3822.       IF name=edname THEN line=line'NEW = Change User.'
  3823.       line=pen3||line||def||lineup
  3824.       SAY line
  3825.     END
  3826.   num=getinput(1 0 'Select Line Number To Edit: ')
  3827.   IF num='NEW' & edata.20>sysoplevel & edname=name THEN    /* select a new user */
  3828.     DO
  3829.       new=1
  3830.       IF change THEN
  3831.         DO
  3832.           CALL SetData()
  3833.           CALL saveData(1)
  3834.         END
  3835.       change=0
  3836.       nufile=bbspath'Lists/NEW_USERS'
  3837.       IF EXISTS(nufile) THEN
  3838.         IF ~readlines(nufile 1) THEN CALL seelines(0)
  3839.       savename=name
  3840.       name=getinput(1 0 'New User Name: 'def)
  3841.       name=SPACE(name,1,'_')
  3842.       name=COMPRESS(name,':/*#?^')
  3843.       IF loadData()=0 THEN name=savename
  3844.       IF data.20>=edata.20 THEN
  3845.         DO
  3846.           SAY 'Can''t Edit!' pen3||name def'has an equal or higher level than thee.'
  3847.           name=savename
  3848.           CALL loadData()
  3849.         END
  3850.     END
  3851.   ELSE IF DATATYPE(num,'W') & num>0 THEN
  3852.     DO
  3853.       IF num>maxnum THEN
  3854.         DO
  3855.           SAY 
  3856.           SAY pen3'You are not authorized to change that information!'def
  3857.           SAY 
  3858.         END
  3859.       ELSE
  3860.         DO dummy=1 TO 1
  3861.           IF num=8 THEN
  3862.             DO
  3863.               SAY
  3864.               SAY 'Use spaces to seperate options.'
  3865.               SAY 'If the option word is in line 8, it is ON.'
  3866.               SAY 'Valid Options:'
  3867.               SAY '        MENU   combines all main commands into 1 menu.'
  3868.               SAY '        MENUS  splits main commands into 3 menus.'
  3869.               SAY '        COLOR  turns ANSI color codes ON.'
  3870.               SAY '        PHONE  makes your phone number public.'
  3871.               SAY '        QUICK  for long distance callers. See BBBBS.REVISION'
  3872.               SAY '        STREET makes your street address public.'
  3873.               SAY '        TERSE  skips some of the logon procedures.'
  3874.               SAY
  3875.             END
  3876.           line=RIGHT(num,2)||pen3 text.num||def': '
  3877.           SAY line||data.num
  3878.           temp=getinput(0 0 line)
  3879.           IF temp='' THEN
  3880.             DO
  3881.               IF num=1 | num=4 | num=5 | num=6 | num=7 THEN LEAVE dummy
  3882.               IF num=11 | num=12 | num=13 | num=20 THEN LEAVE dummy
  3883.             END
  3884.           IF num=5 | num=8 THEN temp=UPPER(temp)
  3885.           IF num=20 & DATATYPE(temp,'W') & temp>=edata.20 THEN
  3886.             temp=data.20
  3887.           IF edata.20>sysoplevel & name~=edname THEN line2=name' '
  3888.           ELSE line2=''
  3889.           IF num=21 & name=edname & edata.20<99 THEN LEAVE dummy
  3890.           line=text.num':' data.num pen6'CHANGED TO'def temp
  3891.           data.num=temp
  3892.           SAY line
  3893.           SAY 
  3894.           change=1
  3895.         END
  3896.     END
  3897. END
  3898. IF change THEN
  3899.   DO
  3900.     CALL SetData()
  3901.     CALL saveData(1)
  3902.   END
  3903. RETURN
  3904.  
  3905.  
  3906. getnumber:
  3907. PARSE ARG tprompt
  3908. tnum=getinput(1 0 '  'tprompt' > ')
  3909. mask=COMPRESS(XRANGE(),'0123456789')
  3910. tnum=COMPRESS(tnum,mask)
  3911. IF ~DATATYPE(tnum,'W') THEN tnum=0
  3912. tnum=tnum%1
  3913. IF tnum>0 & tnum<10 THEN tnum='0'tnum
  3914. RETURN tnum
  3915.  
  3916.  
  3917. getbirth:
  3918. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  Birthday:'
  3919. SAY pen3'Please enter your birthday.'def
  3920. month=getnumber('month: (1-12)')
  3921. day=getnumber('  day: (1-31)')
  3922. year=getnumber(' year:       ')
  3923. IF year<100 THEN year=year+1900
  3924. born=year||month||day
  3925. IF born<18750101 | born>(DATE('S')-50000) THEN
  3926.   DO
  3927.     born=''
  3928.     IF getinput(1 1 'Would you rather skip this question? (Ny) > ')~='Y' THEN
  3929.       CALL getbirth()
  3930.   END
  3931. data.12=WORD(data.12,1)'  'WORD(data.12,2)'  'WORD(data.12,3)' 'WORD(born,1)
  3932. RETURN
  3933.  
  3934.  
  3935. getname:
  3936. CALL showuserlist()
  3937. SAY
  3938. name=getinput(1 0 'Please enter your full Email name : ')
  3939. IF name='' THEN
  3940.   DO
  3941.     SAY 'No name, no entry.  Bye!'
  3942.     SIGNAL DONE
  3943.   END
  3944. name=SPACE(name,1,'_')
  3945. name=COMPRESS(name,':/*#?^')
  3946. IF FIND(userlist,name)>0 | FIND(exclusion,name)>0 THEN
  3947.   DO
  3948.     SAY 'Sorry! That name is taken. Please try again.'
  3949.     RETURN 1
  3950.   END
  3951. RETURN 0
  3952.  
  3953.  
  3954. /** see if name is in data */
  3955.  
  3956. checkUser:
  3957. tries=0
  3958. IF name='NEW' THEN
  3959.   DO
  3960.     name=''
  3961.     DO WHILE getname()
  3962.     END
  3963.   END
  3964. IF FIND(userlist,name)=0 THEN
  3965.   DO
  3966.     IF EXISTS(bbspath'BBS_TEXT/NEW') THEN
  3967.       DO
  3968.         nonstop=0
  3969.         CALL readlines(bbspath'BBS_TEXT/NEW' 1)
  3970.         CALL seelines(0)
  3971.         CALL waiting()
  3972.       END
  3973.     SAY
  3974.     defile=bbspath'BBS_TEXT/DEF.NEW_USER'
  3975.     CALL loadcourtesy()
  3976.     wordnum=FIND(courtesy,name)
  3977.     IF wordnum>0 THEN
  3978.       DO
  3979.         SAY name', is on the Courtesy List. You will be granted immediate access.'
  3980.         courtesy=STRIP(DELWORD(courtesy,wordnum,1))
  3981.         IF writeopen(bbspath'Lists/Courtesy') THEN
  3982.           DO
  3983.             DO i=1 TO WORDS(courtesy)
  3984.               CALL WRITELN(f,WORD(courtesy,i))
  3985.             END
  3986.             CALL CLOSE(f)
  3987.           END
  3988.         defile=bbspath'BBS_TEXT/DEF.COURTESY'
  3989.       END
  3990.     ELSE IF bbsprefs.7=0 THEN SAY name', You have new user access.'
  3991.     IF readlines(defile 1) THEN SIGNAL DONE
  3992.     data.=''
  3993.     data.0=24
  3994.     DO i=6 TO 22
  3995.       data.i=lynes.i
  3996.     END
  3997.     data.12=DATE('S')'  'TIME('C')
  3998.     data.13=data.12
  3999.     lastondate=DATE('I')-1
  4000.     lastontime=TIME('C')
  4001.     SAY 'Please enter the password you would like to use here.'
  4002.     data.5=getinput(1 0 'Password: ')
  4003.     IF data.5='' THEN
  4004.       DO
  4005.         line=''name 'refused to enter a password.'
  4006.         SIGNAL DONE
  4007.       END
  4008.     data.1=''
  4009.     DO WHILE data.1=''
  4010.       data.1=getinput(0 0 'Full Name: ')
  4011.       IF data.1='' THEN SAY 'You MUST leave your real name!'
  4012.     END
  4013.     data.2=getinput(0 0 'Street: ')
  4014.     data.3=getinput(0 0 'City, State Zip: ')
  4015.     data.4=''
  4016.     DO WHILE data.4=''
  4017.       data.4=getinput(0 0 'Phone: ')
  4018.       IF data.4='' THEN
  4019.         SAY sysop 'MUST be able to reach you by phone to validate you!'
  4020.     END
  4021.     CALL getbirth()
  4022.     IF bbsprefs.8 THEN
  4023.       DO
  4024.         newufile=bbspath'Lists/NEW_USERS'
  4025.         IF EXISTS(newufile) THEN ok=OPEN(f,newufile,'A')
  4026.         ELSE
  4027.           DO
  4028.             ok=OPEN(f,newufile,'W')
  4029.             IF ok~=0 THEN CALL WRITELN(f,'*** New Users ***')
  4030.           END
  4031.         IF ok~=0 THEN CALL WRITELN(f,DATE() TIME() name' = 'data.1'   'data.4)
  4032.         CALL CLOSE(f)
  4033.       END
  4034.     data.9=getinput(0 0 'Computer: ')
  4035.     data.10=getinput(0 0 'Interests: ')
  4036.     test=getinput(1 1 pen3'Do you want other users to see your STREET address? (Ny) > 'def)
  4037.     IF test='Y' THEN data.8=data.8 'STREET'
  4038.     test=getinput(1 1 pen3'Do you want other users to see your PHONE number? (Ny) > 'def)
  4039.     IF test='Y' THEN data.8=data.8 'PHONE'
  4040.     IF bbsprefs.7>0 THEN
  4041.       DO
  4042.         data.20=bbsprefs.7
  4043.         data.11='60 minutes' bbsprefs.16-1 'more times today'
  4044.       END
  4045.     SAY
  4046.     IF data.20=0 THEN
  4047.       SAY 'Thank you, the sysop will give you higher access soon.'
  4048.     SAY 'Please feel free to leave additional info by using [C]omment.'
  4049.     SAY
  4050.     CALL SetData()
  4051.     CALL saveData(1)
  4052.     SAY 'Adding' name 'to the user list...'
  4053.     newpassword=data.5
  4054.     sortuserflag=1
  4055.     temp=countcheck(bbspath'Numbers/Users' 0)+1
  4056.     CALL countcheck(bbspath'Numbers/Users' temp)
  4057.     CALL DELETE(bbspath'Lists/USERS')
  4058.   END
  4059. ELSE
  4060.   DO
  4061.     IF loadData()=0 THEN SIGNAL DONE
  4062.     PARSE VAR data.11 amins . atimes .
  4063.     lastondate=DATE('I',WORD(data.13,1),'S')
  4064.     lastontime=WORD(data.13,2)
  4065.     IF DATE('I')>lastondate | level>sysoplevel THEN atimes=bbsprefs.16
  4066.     IF level=99 THEN amins=120
  4067.     data.13=DATE('S')'  'TIME()
  4068.     data.11=amins 'minutes' atimes-1 'more times today'
  4069.     passprompt='Enter Password: '
  4070.     DO tries=1 TO 3
  4071.       OPTIONS PROMPT passprompt
  4072.       PULL newpassword
  4073.       SAY ''
  4074.       IF(password=newpassword) THEN LEAVE tries; /* correct password */
  4075.       IF tries=3 THEN
  4076.         DO
  4077.           SAY 
  4078.           SAY 'Access terminated.'
  4079.           line='*** Bad password ***' newpassword '***'
  4080.           SAY line
  4081.           SIGNAL OUT2
  4082.         END
  4083.       SAY lineup'                                 '
  4084.       passprompt='Incorrect.  Password: ' /* ask again */
  4085.     END
  4086.   END
  4087. CALL DELAY(14)
  4088. SAY 
  4089. RETURN
  4090.  
  4091.  
  4092. saveData:
  4093. ARG messflag .
  4094. IF data.5='' THEN RETURN
  4095. SAY 'Updating...             'lineup
  4096. IF newfilesdate~='' THEN data.16=lastbrowse newfilesdate
  4097. ELSE IF lastbrowse>0 THEN
  4098.   DO
  4099.     IF WORDS(data.16)>1 THEN data.16=DELWORD(data.16,1,1)
  4100.     ELSE data.16=DATE('S') TIME()
  4101.     data.16=lastbrowse data.16
  4102.   END
  4103. IF messflag THEN
  4104.   DO
  4105.     userexclude.=0
  4106.     DO si=1 TO WORDS(data.22)
  4107.       IF WORD(data.22,si)=-1 THEN userexclude.si=1
  4108.     END
  4109.     data.22=''
  4110.     data.23=''
  4111.     DO si=1 TO level
  4112.       IF ~DATATYPE(lastread.si,'W') THEN lastread.si=0
  4113.       IF userexclude.si THEN data.22=data.22 '-1'
  4114.       ELSE data.22=data.22 lastread.si
  4115.       IF ~DATATYPE(totwrit.si,'W') THEN totwrit.si=0
  4116.       data.23=data.23 totwrit.si
  4117.     END
  4118.   END
  4119. IF writeopen(bbspath'USERS/'name)=0 THEN RETURN
  4120. IF data.0<26 THEN data.0=26
  4121. DO i=1 TO data.0
  4122.   CALL WRITELN(f,data.i)
  4123. END
  4124. CALL CLOSE(f)
  4125. SAY 'User' name 'has been updated.'
  4126. RETURN
  4127.  
  4128.  
  4129. loadData:
  4130. IF name='' THEN RETURN 0
  4131. IF ~readopen(bbspath'USERS/'name) THEN RETURN 0
  4132. data.=''
  4133. DO i=1
  4134.   line=READLN(f)
  4135.   IF EOF(f) THEN BREAK
  4136.   data.i=line
  4137. END
  4138. data.0=i-1
  4139. CALL CLOSE(f)
  4140. winnings=WORD(data.18,1)
  4141. IF ~DATATYPE(winnings,'N') THEN winnings=0
  4142.  
  4143. setData:
  4144. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  4145. lastbrowse=WORD(data.16,1)
  4146. IF ~DATATYPE(lastbrowse,'W') THEN lastbrowse=0
  4147. level=data.20
  4148. DO i=1 TO level
  4149.   lastread.i=WORD(data.22,i)
  4150.   IF ~DATATYPE(lastread.i,'W') THEN lastread.i=0
  4151.   totwrit.i=WORD(data.23,i)
  4152.   IF ~DATATYPE(totwrit.i,'W') THEN totwrit.i=0
  4153. END
  4154. password=data.5
  4155. IF ~DATATYPE(data.7,'W') THEN data.7=20
  4156. IF data.7<5 THEN data.7=5
  4157. IF FIND(UPPER(data.8),'TERSE')>0 THEN terseflag=1
  4158. ELSE terseflag=0
  4159. IF FIND(UPPER(data.8),'COLOR')>0 THEN colorflag=1
  4160. ELSE colorflag=0
  4161. CALL colors(colorflag)
  4162. menu='ALL'
  4163. IF FIND(UPPER(data.8),'MENUS')>0 THEN
  4164.   DO
  4165.     menuflag=1
  4166.     menu='MAIN'
  4167.   END
  4168. ELSE IF FIND(UPPER(data.8),'MENU')>0 THEN menuflag=1
  4169. ELSE menuflag=0
  4170. IF level=0 THEN menu='NEW'
  4171. data.21=UPPER(data.21)
  4172. maxtime=WORD(data.11,1)*60
  4173. RETURN 1
  4174.  
  4175.  
  4176. switchmenuflag:
  4177. IF menuflag=1 THEN
  4178.   DO
  4179.     menuflag=0
  4180.     noff='OFF'
  4181.   END
  4182. ELSE
  4183.   DO
  4184.     menuflag=1
  4185.     noff='ON'
  4186.   END
  4187. SAY 'Menus turned' pen3||noff||def'.'
  4188. SAY 'To make a permanent change, add or delete MENU(S) from [Y]our userdata item 8.'
  4189. RETURN
  4190.  
  4191.  
  4192. switchcolors:
  4193. IF colorflag=1 THEN
  4194.   DO
  4195.     colorflag=0
  4196.     noff='OFF'
  4197.   END
  4198. ELSE
  4199.   DO
  4200.     colorflag=1
  4201.     noff='ON'
  4202.   END
  4203. CALL colors(colorflag)
  4204. SAY 'Color turned' pen3||noff||def'.'
  4205. SAY 'To make a permanent change, add or delete COLOR from [Y]our userdata item 8.'
  4206. RETURN
  4207.  
  4208.  
  4209. /* ANSI pen color codes */
  4210. colors:
  4211. ARG onoff
  4212. IF onoff THEN
  4213.   DO
  4214.     lineup='1B'x'M'
  4215.     def='';  /* default */
  4216.     pen0='';  pen1='';  pen2='';  pen3=''
  4217.     pen4='';  pen5='';  pen6='';  pen7=''
  4218.     bak0='';  bak1='';  bak2='';  bak3=''
  4219.     bak4='';  bak5='';  bak6='';  bak7=''
  4220.   END
  4221. ELSE
  4222.   DO
  4223.     pen0=''; pen1=''; pen2=''; pen3=''; pen4=''; pen5=''; pen6=''; pen7=''
  4224.     bak0=''; bak1=''; bak2=''; bak3=''; bak4=''; bak5=''; bak6=''; bak7=''
  4225.     def='';  lineup=''
  4226.   END
  4227. RETURN
  4228.  
  4229.  
  4230. sortinfofiles:
  4231. infolist=SHOWDIR(bbspath'Information')
  4232. IF infolist='' THEN
  4233.   DO
  4234.     SAY 
  4235.     SAY pen3'No files are currently in the Information drawer.'def
  4236.     SAY 
  4237.     RETURN 1
  4238.   END
  4239. IF ~DATATYPE(sortinfo.0,'W') THEN
  4240.   DO
  4241.     info.=''
  4242.     sortinfo.=''
  4243.     info.0=WORDS(infolist)
  4244.     DO i=1 TO info.0
  4245.       info.i=WORD(infolist,i)
  4246.     END
  4247.     SAY 'Sorting..'
  4248.     CALL QSORT(1,info.0,info)
  4249.     sortinfo.0=info.0%3
  4250.     IF (info.0//3)>0 THEN sortinfo.0=sortinfo.0+1
  4251.     DO i=1 TO sortinfo.0
  4252.       sortinfo.i=''
  4253.       DO j=0 TO 2
  4254.         k=i+j*sortinfo.0
  4255.         IF k<=info.0 THEN
  4256.           DO
  4257.             sortinfo.i=sortinfo.i RIGHT(k,3)'.' LEFT(info.k,19)
  4258.             infocount=WORD(STATEF(bbspath'Information/'info.k),8)
  4259.             sortinfo.i.0=sortinfo.i.0||RIGHT(infocount,5) LEFT(info.k,19)
  4260.           END
  4261.       END
  4262.     END
  4263.     SAY lineup'         'lineup
  4264.   END
  4265. RETURN 0
  4266.  
  4267.  
  4268. information:
  4269. IF sortinfofiles() THEN RETURN
  4270. SAY pen3'These text files are available for reading online...'def
  4271. num=1
  4272. readcount=-1
  4273. DO infoloop=1
  4274.   IF num=0 THEN
  4275.     DO
  4276.       IF readcount~=-1 THEN
  4277.         DO
  4278.           sortinfo.0=''
  4279.           IF sortinfofiles() THEN RETURN
  4280.         END
  4281.       SAY CENTER('- Number of accesses per file -',75)
  4282.     END
  4283.   SAY pen3||LEFT('-',75,'-')||def
  4284.   IF num=0 THEN
  4285.     DO i=1 TO sortinfo.0
  4286.       SAY sortinfo.i.0
  4287.     END
  4288.   ELSE
  4289.     DO i=1 TO sortinfo.0
  4290.       SAY sortinfo.i
  4291.     END
  4292.   IF num=0 THEN
  4293.     DO
  4294.       CALL waiting()
  4295.       num=1
  4296.       ITERATE infoloop
  4297.     END
  4298.   num=getinput(1 0 pen3'Select Number Of Information File To View. 0=Stats > 'def)
  4299.   IF num=0 THEN ITERATE infoloop
  4300.   IF ~DATATYPE(num,'W') | num<1 | num>info.0 THEN RETURN
  4301.   readcount=STATEF(bbspath'Information/'info.num)
  4302.   readbytes=WORD(readcount,2)
  4303.   readcount=WORD(readcount,8)
  4304.   IF ~DATATYPE(readcount,'W') THEN readcount=0
  4305.   SAY '  'info.num 'is' readbytes 'bytes.'
  4306.   SAY 'Loading File...'
  4307.   ADDRESS COMMAND 'C:filenote' bbspath'Information/'info.num readcount+1
  4308.   CALL readlines(bbspath'Information/'info.num 1)
  4309.   CALL cleanline(0)
  4310.   SAY '    'lynes.0 'lines.'
  4311.   CALL seelines(0)
  4312.   IF waitchar~='Q' THEN CALL waiting()
  4313.   nonstop=0
  4314. END
  4315. RETURN
  4316.  
  4317.  
  4318. newfiles:
  4319. SAY 
  4320. test=''
  4321. test=getinput(1 1 'Show one library only? (Ny) > ')
  4322. IF test='Y' THEN
  4323.   IF chdir()>0 THEN RETURN
  4324. SAY 'Searching for new (un-browsed) files since' DATE(,WORD(data.16,2),'S') 'at' WORD(data.16,3)'...'
  4325. lastbrowz=WORD(data.16,1)
  4326. lastfileup=countcheck(bbspath'Numbers/LastFile' 0)
  4327. IF lastbrowz>=lastfileup THEN
  4328.   DO
  4329.     lastbrowz=0
  4330.     SAY pen3'No new files. Listing backwards by date from last file uploaded...'def
  4331.   END
  4332. ELSE newfilesflag=1
  4333. j=0
  4334. IF test='Y' THEN filecount=WORDS(SHOWDIR(bbspath'FileNotes/'plaindir))
  4335. DO ni=lastfileup TO lastbrowz+1 BY -1
  4336.   IF files.ni~='' THEN
  4337.     DO
  4338.       IF test='Y' THEN 
  4339.         DO
  4340.           IF j>=filecount THEN LEAVE ni
  4341.           IF UPPER(LEFT(WORD(files.ni,1),12))~=UPPER(LEFT(plaindir,12)) THEN
  4342.             ITERATE ni
  4343.         END
  4344.       jj=files.ni.0
  4345.       IF WORD(alpha.jj,4)>level | FIND(data.21,UPPER(WORD(files.ni,1)))>0 THEN
  4346.         ITERATE ni  /* unauthorized */
  4347.       j=j+1
  4348.       IF j=1 THEN CALL fileheader()
  4349.       SAY LEFT(alpha.jj,76)
  4350.       IF (j+2)//(linesperpage-1)=0 THEN
  4351.         IF waiting2() THEN LEAVE ni
  4352.     END
  4353. END
  4354. IF j//linesperpage~=0 THEN CALL waiting()
  4355. IF test~='Y' THEN
  4356.   DO
  4357.     CALL newinfo()
  4358.     IF lynes.0>0 THEN CALL waiting()
  4359.   END
  4360. nonstop=0
  4361. RETURN
  4362.  
  4363.  
  4364. newinfo:
  4365. lynes.=''
  4366. lynes.0=0
  4367. dm=DATE(,WORD(data.16,2),'S')
  4368. PARSE VAR dm da' 'mo' 'yr .
  4369. yr=RIGHT(yr,2)
  4370. sincedate=da'-'mo'-'yr
  4371. startline=1
  4372. arg=bbspath'Information'
  4373. IF WORD(STATEF(arg),5)>lastondate THEN
  4374.   DO
  4375.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4376.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4377.       DO
  4378.         lynes.startline=pen1||bak2' New or Updated Information Files. Enter'def pen3'I'def bak2'from the main menu to read 'def
  4379.         CALL readlines('ram:locdirlist' startline+1)
  4380.       END
  4381.   END
  4382. arg=bbspath'Profiles'
  4383. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4384.   DO
  4385.     ADDRESS COMMAND 'C:LIST >ram:locdirlist' arg 'NOHEAD DATES SINCE' sincedate
  4386.     IF WORD(STATEF('ram:locdirlist'),2)>3 THEN
  4387.       DO
  4388.         startline=lynes.0+2
  4389.         lynes.startline=pen1||bak2' New or Updated User Profiles. Enter'def pen3'&'def bak2'from the main menu to read 'def
  4390.         CALL readlines('ram:locdirlist' startline+1)
  4391.       END
  4392.   END
  4393. arg=bbspath'rexxDoors/Data/Polls'
  4394. IF level>0 & WORD(STATEF(arg),5)>lastondate THEN
  4395.   DO
  4396.     startline=lynes.0+2
  4397.     lynes.startline=pen1||bak2' Voting Activity. Enter'def pen3'J'def bak2'from the main menu, then select Polling_Place 'def
  4398.     lynes.0=startline
  4399.   END
  4400. IF logonflag=1 THEN nonstop=1
  4401. IF lynes.0>0 THEN CALL seelines(1)
  4402. nonstop=0
  4403. RETURN
  4404.  
  4405.  
  4406. areaselect:
  4407. SAY pen3||LEFT('-',75,'-')||def
  4408. DO i=1 TO msgs.0
  4409.   SAY msgs.i
  4410.   IF i//linesperpage=0 THEN CALL waiting()
  4411. END
  4412. temp=getinput(1 0 pen3'Select Message Conference: 'def)
  4413. IF ~DATATYPE(temp,'W') | temp<1 | temp>level | FIND(data.21,temp)>0 THEN RETURN 1
  4414. msgdir=temp
  4415. RETURN 0
  4416.  
  4417.  
  4418. chdir:
  4419. string=''
  4420. SAY pen3||LEFT('-',75,'-')||def
  4421. DO i=1 TO libs.0
  4422.   SAY libs.i
  4423. END
  4424. dirnum=getinput(1 0 pen3'Select Library Number: 'def)
  4425. IF ~DATATYPE(dirnum,'W') THEN
  4426.   DO
  4427.     waitchar=dirnum
  4428.     RETURN 2
  4429.   END
  4430.  
  4431. chdir2:
  4432. IF dirnum<1 | dirnum>99 THEN
  4433.   DO
  4434.     waitchar=dirnum
  4435.     RETURN 1
  4436.   END
  4437. IF dirs.dirnum='' THEN
  4438.   DO
  4439.     SAY pen3'That library number is currently un-assigned.'def
  4440.     RETURN 1
  4441.   END
  4442. IF dirnum>level | FIND(data.21,UPPER(dirs.dirnum))>0 THEN
  4443.   DO
  4444.     SAY pen3'You do not have authorization for that library!'def
  4445.     RETURN 1
  4446.   END
  4447. IF dirs.dirnum~='' THEN
  4448.   DO
  4449.     CALL MAKEDIR(libpath||dirs.dirnum)
  4450.     CALL setdir(libpath||dirs.dirnum)
  4451.   END
  4452. RETURN 0
  4453.  
  4454.  
  4455. since:
  4456. dm=DATE(,WORD(data.16,2),'S')
  4457. SAY 
  4458. SAY 'New files or files moved since' dm
  4459. CALL listsince()
  4460. CALL readlines('ram:locdirlist' 1)
  4461. CALL seelines(1)
  4462. nonstop=0
  4463. CALL waiting()
  4464. RETURN
  4465.  
  4466.  
  4467. listsince:
  4468. dm=DATE(,WORD(data.16,2),'S')
  4469. PARSE VAR dm da' 'mo' 'yr .
  4470. yr=RIGHT(yr,2)
  4471. sincedate=da'-'mo'-'yr
  4472. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES SINCE' sincedate
  4473. RETURN
  4474.  
  4475.  
  4476. list:
  4477. onetime=0
  4478. IF DATATYPE(arg,'W') THEN onetime=1
  4479. ELSE arg=''
  4480. DO listloop=1
  4481.   IF DATATYPE(arg,'W') THEN
  4482.     DO
  4483.       dirnum=arg
  4484.       arg=''
  4485.       IF chdir2()>0 THEN RETURN
  4486.       CALL listsimple()
  4487.       IF waitchar='Q' THEN RETURN
  4488.       IF onetime THEN LEAVE listloop
  4489.     END
  4490.   ELSE IF arg='' THEN
  4491.     DO
  4492.       IF chdir()>0 THEN RETURN
  4493.       test='Y'
  4494.       CALL showalpha2()
  4495.       arg=''
  4496.       ITERATE listloop
  4497.     END
  4498.   ELSE RETURN
  4499. END
  4500. RETURN
  4501.  
  4502.  
  4503. listsimple:
  4504. ADDRESS COMMAND 'C:list >ram:locdirlist' directory 'DATES'
  4505. IF readlines('ram:locdirlist' 1) THEN RETURN
  4506. IF lynes.0>3 THEN
  4507.   DO
  4508.     SAY pen3'Sorting...'def||lineup
  4509.     linesave=lynes.1  /* these 4 lines put in to leave dir title at top */
  4510.     lynes.1='0'
  4511.     CALL QSORT(1,lynes.0-1,lynes)
  4512.     CALL DELAY(14)
  4513.     lynes.1=linesave
  4514.   END
  4515. CALL seelines(1)
  4516. nonstop=0
  4517. CALL waiting()
  4518. RETURN
  4519.  
  4520.  
  4521. browse:
  4522. curdironly=0
  4523. brdir=PRAGMA('D')
  4524. brfilenum=1
  4525. nonstop=0
  4526. IF files.0<1 THEN RETURN
  4527. lastfilenum=countcheck(bbspath'Numbers/LastFile' 0)
  4528. IF lastfilenum<1 THEN RETURN
  4529. IF arg='' THEN
  4530.   DO
  4531.     test=getinput(1 1 '['pen3'R'def']ead descriptions or ['pen3'A'def']rchive for later download. (aR) > ')
  4532.     IF test='A' THEN
  4533.       DO
  4534.         IF STORAGE()<(bbsprefs.15+100000) THEN
  4535.           DO
  4536.             SAY
  4537.             SAY 'Sorry! Not enough memory left for background archiving.'
  4538.             SAY 'Please try again in 10 minutes or so.'
  4539.             SAY
  4540.             RETURN
  4541.           END
  4542.         CALL Make_BrowseList.baud(name)
  4543.         IF countcheck(bbspath'Numbers/LastFile' 0)>lastfilenum THEN
  4544.           IF emailonline>=0 THEN emailonline=emailonline+1
  4545.         RETURN
  4546.       END
  4547.     line='Browsing'
  4548.     test=getinput(1 1 'Browse one library only? (Ny) > ')
  4549.     IF test='Y' THEN
  4550.       DO
  4551.         IF chdir()>0 THEN RETURN
  4552.         curdironly=1
  4553.         line=line 'the' pen3||plaindir||def 'library'
  4554.       END
  4555.     ELSE line=line 'all file libraries'
  4556.     line=line 'backwards from latest file.'
  4557.     SAY line
  4558.   END
  4559. i=0
  4560. IF arg='' | UPPER(arg)='NEW' | UPPER(arg)='ALL' THEN
  4561.   DO lastfileloop=1
  4562.     IF lastfilenum<1 THEN RETURN
  4563.     arg=WORD(files.lastfilenum,2)
  4564.     brfilenum=lastfilenum
  4565.     IF WORD(files.lastfilenum,2)~='' THEN LEAVE lastfileloop
  4566.     lastfilenum=lastfilenum-1
  4567.   END
  4568. ELSE IF DATATYPE(arg,'W') & files.arg~='' THEN
  4569.   DO
  4570.     brfilenum=arg
  4571.     arg=WORD(files.arg,2)
  4572.   END
  4573. ELSE
  4574.   DO
  4575.     DO i=1 TO lastfilenum+1
  4576.       IF UPPER(WORD(files.i,2))~=UPPER(arg) THEN ITERATE i
  4577.       brfilenum=i
  4578.       LEAVE i
  4579.     END
  4580.     IF i>lastfilenum THEN
  4581.       DO
  4582.         SAY 'Unable to find a file description for' pen3||arg||def'.'
  4583.         RETURN
  4584.       END
  4585.   END
  4586. IF ~curdironly THEN CALL setdir(libpath||WORD(files.brfilenum,1))
  4587. savearg=arg
  4588. IF brfilenum>lastfilenum THEN brfilenum=lastfilenum
  4589. newfilesdate=DATE('S') TIME()
  4590. DO browseloop=1
  4591.   DO i=brfilenum TO 0 BY -1
  4592.     IF files.i='' THEN ITERATE i
  4593.     testdir=UPPER(WORD(files.i,1))
  4594.     IF curdironly & UPPER(plaindir)~=UPPER(testdir) THEN
  4595.       DO
  4596.         IF i>lastbrowse THEN lastbrowse=i
  4597.         ITERATE i
  4598.       END
  4599.     IF FIND(data.21,testdir)>0 | finddirnum(testdir)>level THEN
  4600.       DO
  4601.         IF i>lastbrowse THEN lastbrowse=i
  4602.         ITERATE i
  4603.       END
  4604.     LEAVE i
  4605.   END
  4606.   IF i=0 THEN brfilenum=lastbrowse
  4607.   ELSE brfilenum=i
  4608.   argname=WORD(files.brfilenum,2)
  4609.   IF argname='' THEN RETURN
  4610.   CALL setdir(libpath||WORD(files.brfilenum,1))
  4611.   arg=bbspath'FileNotes/'plaindir'/'argname
  4612.   CALL readlines(arg 1)
  4613.   IF nonstop=1 THEN brostop=1
  4614.   ELSE brostop=0
  4615.   CALL seelines(1)
  4616.   IF brfilenum>lastbrowse THEN lastbrowse=brfilenum
  4617.   IF brostop THEN
  4618.     DO
  4619.       SAY
  4620.       nonstop=1
  4621.       brfilenum=brfilenum-1
  4622.     END
  4623.   ELSE
  4624.     DO
  4625.       line=''
  4626.       endtest=UPPER(RIGHT(argname,4))
  4627.       IF FIND('.ARC .ARJ .DMS .LZH .LHA .RUN .ZIP .ZOO',endtest)>0 THEN
  4628.         line='['pen3'C'def']ontents ['pen3'D'def']ownload'
  4629.       ELSE line='['pen3'D'def']ownload'
  4630.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4631.         line=line '['pen3'E'def']dit'
  4632.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4633.         line=line '['pen3'K'def']ill'
  4634.       IF level>sysoplevel THEN line=line '['pen3'L'def']ib'
  4635.       line=line '['pen3'M'def']ark ['pen3'N'def']on-Stop'
  4636.       IF endtest='.TXT' THEN line=line '['pen3'R'def']ead'
  4637.       line=line '['pen3'Q'def']uit ['pen3'?'def'] > '
  4638.       brcom=getinput(1 0 line)
  4639.       IF DATATYPE(brcom,'W') THEN
  4640.         DO
  4641.           brfilenum=brcom+1
  4642.           IF brfilenum>lastfilenum THEN brfilenum=lastfilenum+1
  4643.           IF brfilenum<1 THEN brfilenum=1
  4644.           SAY
  4645.         END
  4646.       ELSE brcom=LEFT(brcom,1)
  4647.       CALL cleanline(0)
  4648.       IF brcom='Q' THEN LEAVE browseloop
  4649.       IF brcom='M' THEN
  4650.         DO
  4651.           wordnum=FIND(data.25,brfilenum)
  4652.           IF wordnum=0 THEN
  4653.             DO
  4654.               data.25=STRIP(data.25 brfilenum)
  4655.               SAY lineup||argname 'marked for next download.'
  4656.               SAY
  4657.             END
  4658.           ELSE
  4659.             DO
  4660.               data.25=STRIP(DELWORD(data.25,wordnum,1))
  4661.               SAY argname 'removed from download list.'
  4662.             END
  4663.         END
  4664.       IF brcom='H' | brcom='?' THEN
  4665.         DO
  4666.           SAY pen3' - HELP with the Browse Files commands -'def
  4667.           SAY ' RETURN reads the next file description in line.'
  4668.           SAY ' 34 will display the description of file number 34, if it exists.'
  4669.           SAY ' C  displays the contents of an archived (arc dms lzh lha zip zoo) file.'
  4670.           SAY ' D  displays the download menu.'
  4671.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4672.             DO
  4673.           SAY ' E  puts this file description into the online Editor.'
  4674.           SAY ' K  deletes a file you uploaded. you cannot Kill others!'
  4675.             END
  4676.           IF level>sysoplevel THEN
  4677.           SAY ' L  move file and description to new Library and/or rename.'
  4678.           SAY ' M  mark/unmark the current file for the next download'
  4679.           SAY ' N  displays all descriptions without pausing. CTRL-E to Exit!'
  4680.           SAY ' R  displays file as text. - ONLY FILES THAT END IN .TXT -'
  4681.           SAY ' Q  returns to the main menu(s). (Quit)'
  4682.           SAY
  4683.           CALL waiting()
  4684.           IF waitchar='Q' THEN LEAVE browseloop
  4685.         END
  4686.       ELSE IF brcom='L' & level>sysoplevel THEN
  4687.         DO
  4688.           curdir=PRAGMA('D')
  4689.           IF getinput(1 1 'Rename' argname '? (Ny) > ')='Y' THEN
  4690.             DO
  4691.               newarg=getinput(0 0 'Rename' argname 'to ')
  4692.               IF newarg~='' THEN
  4693.                 DO
  4694.                   IF is_here(newarg) THEN ITERATE browseloop
  4695.                   IF EXISTS(libpath||filedir'/'newarg) THEN
  4696.                     DO
  4697.                       SAY
  4698.                       SAY '***' newarg 'already exists!'
  4699.                       SAY
  4700.                       ITERATE browseloop
  4701.                     END
  4702.                   junk=getinput(1 1 'Are you SURE you want to rename' argname 'to' newarg'? (Ny) ')
  4703.                   IF junk='Y' THEN
  4704.                     DO
  4705.                       lynes.2=OVERLAY(newarg,lynes.2,7,25)
  4706.                       comment=WORD(STATEF(arg),8)
  4707.                       CALL DELETE(arg)
  4708.                       arg=bbspath'FileNotes/'plaindir'/'newarg
  4709.                       CALL savelines(arg)
  4710.                       IF comment~='' THEN
  4711.                         ADDRESS COMMAND 'C:FileNote' arg comment
  4712.                       mpath=libpath||plaindir
  4713.                       CALL RENAME(mpath'/'argname,mpath'/'newarg)
  4714.                       files.brfilenum=STRIP(WORD(files.brfilenum,1)) newarg
  4715.                       anum=files.brfilenum.0
  4716.                       alpha.anum=OVERLAY(newarg,alpha.anum,1,WORDINDEX(alpha.anum,2)-2)
  4717.                       argname=newarg
  4718.                       sortalphaflag=1
  4719.                       savefileflag=1
  4720.                     END
  4721.                 END
  4722.             END
  4723.           mvdir=getinput(0 0 'Move' argname 'to Library (name|number) ')
  4724.           IF mvdir~='' THEN
  4725.             DO
  4726.               IF DATATYPE(mvdir,'W') THEN
  4727.                 DO
  4728.                   dirnum=mvdir
  4729.                   IF UPPER(dirs.dirnum)~=UPPER(WORD(files.brfilenum,1)) THEN
  4730.                     DO
  4731.                       IF chdir2()=0 THEN
  4732.                         CALL movefile(brfilenum dirs.dirnum)
  4733.                     END
  4734.                 END
  4735.               ELSE
  4736.                 DO
  4737.                   mvdir=STRIP(mvdir)
  4738.                   IF UPPER(mvdir)~=UPPER(WORD(files.brfilenum,1)) THEN
  4739.                     DO
  4740.                       DO mj=1 TO level+1
  4741.                         IF UPPER(mvdir)=UPPER(dirs.mj) THEN LEAVE mj
  4742.                       END
  4743.                       IF mj<=level THEN CALL movefile(brfilenum mvdir)
  4744.                     END
  4745.                 END
  4746.             END
  4747.           IF savefileflag>0 THEN CALL savefilelist()
  4748.           CALL setdir(curdir)
  4749.         END
  4750.       ELSE IF brcom='N' THEN
  4751.         DO
  4752.           brfilenum=brfilenum-1
  4753.           nonstop=1
  4754.           SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E'def
  4755.           SAY
  4756.           CALL DELAY(100)
  4757.           brcom=''
  4758.         END
  4759.       ELSE IF brcom='C' THEN
  4760.         DO
  4761.           temp=STRIP(WORD(STATEF(arg),8))
  4762.           IF temp='' THEN temp=libpath||plaindir'/'argname
  4763.           CALL Contents.rexx(temp)
  4764.           IF EXISTS('RAM:CONTENTS') THEN
  4765.             DO
  4766.               CALL readlines('RAM:CONTENTS' 1)
  4767.               CALL seelines(0)
  4768.               IF waitchar~='Q' THEN CALL waiting()
  4769.               nonstop=0
  4770.             END
  4771.           ELSE SAY pen3'Not an archived file.'def
  4772.         END
  4773.       ELSE IF brcom='D' THEN
  4774.         DO
  4775.           arg2=arg
  4776.           arg=argname
  4777.           CALL dload()
  4778.           arg=arg2
  4779.         END
  4780.       ELSE IF brcom='E' THEN
  4781.         DO
  4782.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4783.             DO
  4784.               firstedit=5
  4785.               IF level>sysoplevel THEN firstedit=1
  4786.               CALL bbsED(firstedit arg)
  4787.             END
  4788.         END
  4789.       ELSE IF brcom='K' THEN
  4790.         DO
  4791.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  4792.             DO
  4793.               IF getinput(1 1 pen3'Do you really want to kill this file? (nY) >'def)~='N' THEN
  4794.                 DO
  4795.                   tempnum=WORD(lynes.1,2)
  4796.                   IF tempnum=lastfilenum THEN
  4797.                     DO
  4798.                       CALL DELETE(bbspath'Numbers/LastFile')
  4799.                       CALL DELAY(28)
  4800.                       lastfilenum=lastfilenum-1
  4801.                       CALL countcheck(bbspath'Numbers/LastFile' lastfilenum)
  4802.                     END
  4803.                   files.tempnum=''
  4804.                   tempnum2=files.tempnum.0
  4805.                   alpha.tempnum2='0 0' tempnum '100'
  4806.                   CALL savefilelist()
  4807.                   CALL DELETE(argname)
  4808.                   CALL DELETE(arg)
  4809.                   SAY argname pen3'has been deleted.'def
  4810.                 END
  4811.             END
  4812.         END
  4813.       ELSE IF brcom='R' & endtest='.TXT' THEN
  4814.         DO
  4815.           vcount=WORD(lynes.2,7)+1
  4816.           lynes.2=STRIP(DELWORD(lynes.2,7)) vcount
  4817.           edtype=''
  4818.           CALL savelines(arg)
  4819.           CALL showtext(argname)
  4820.         END
  4821.       ELSE brfilenum=brfilenum-1
  4822.     END
  4823. END
  4824. CALL setdir(brdir)
  4825. waitchar=''
  4826. IF nonstop THEN CALL waiting()
  4827. nonstop=0
  4828. CALL savedata(0)
  4829. RETURN
  4830.  
  4831.  
  4832. movefile:
  4833. PARSE ARG fnum movdir .
  4834. fromdir=STRIP(WORD(files.fnum,1))
  4835. farg=STRIP(WORD(files.fnum,2))
  4836. CALL MAKEDIR(libpath||movdir)
  4837. ADDRESS COMMAND 'C:COPY' libpath||fromdir'/'farg libpath||movdir
  4838. IF EXISTS(libpath||movdir'/'farg) THEN CALL DELETE(libpath||fromdir'/'farg)
  4839. files.fnum=movdir farg
  4840. lynes.3=DELWORD(lynes.3,WORDS(lynes.3),1)
  4841. lynes.3=STRIP(lynes.3) movdir
  4842. CALL MAKEDIR(bbspath'FileNotes/'movdir)
  4843. CALL savelines(bbspath'FileNotes/'movdir'/'farg)
  4844. ndx=files.fnum.0
  4845. dnum=finddirnum(movdir)
  4846. alpha.ndx=OVERLAY(RIGHT(dnum,2) movdir,alpha.ndx,31,15)
  4847. IF EXISTS(bbspath'FileNotes/'movdir'/'farg) THEN
  4848.   DO
  4849.     temp=bbspath'FileNotes/'fromdir'/'farg
  4850.     comment=WORD(STATEF(temp),8)
  4851.     CALL DELETE(temp)
  4852.     IF comment~='' THEN
  4853.       ADDRESS COMMAND 'C:FileNote' bbspath'FileNotes/'movdir'/'farg comment
  4854.   END
  4855. savefileflag=1
  4856. line='Moved:' fromdir'/'farg 'to' movdir
  4857. SAY line
  4858. RETURN
  4859.  
  4860.  
  4861. textsearch:
  4862. PARSE ARG sfile' 'sarg
  4863. IF sarg='' THEN RETURN 0
  4864. x=OPEN(f,sfile,'R')
  4865. IF x=0 THEN RETURN 0
  4866. sarg=UPPER(sarg)
  4867. stemp=UPPER(READCH(f,65000))
  4868. CALL CLOSE(f)
  4869. retflag=0
  4870. IF POS(sarg,stemp)>0 THEN retflag=1
  4871. DROP stemp
  4872. RETURN retflag
  4873.  
  4874.  
  4875. bbsSEARCH:
  4876. smenu=menu
  4877. test=UPPER(LEFT(arg,1))
  4878. IF test='F' THEN smenu='FILE'
  4879. IF test='M' THEN smenu='MSG'
  4880. IF test='U' THEN smenu='MAIN'
  4881. IF smenu='ALL' THEN
  4882.   DO
  4883.     junk=getinput(1 1 'Search ['pen3'F'def']iles ['pen3'M'def']essages or ['pen3'U'def']sers (fmu) > ')
  4884.     IF junk='F' THEN smenu='FILE'
  4885.     ELSE IF junk='M' THEN smenu='MSG'
  4886.     ELSE IF junk='U' THEN smenu='MAIN'
  4887.     ELSE RETURN
  4888.   END
  4889. IF WORDS(arg)>1 THEN searcharg=UPPER(SUBSTR(arg,WORDINDEX(arg,2)))
  4890. ELSE searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  4891. IF LENGTH(STRIP(searcharg))=0 THEN RETURN
  4892. searcharg=COMPRESS(searcharg,'*')
  4893. IF smenu='NEW' | smenu='MAIN' THEN
  4894.   DO
  4895.     SAY 'Searching Userlist...'
  4896.     DO i=1 TO WORDS(userlist)
  4897.       IF POS(UPPER(searcharg),UPPER(WORD(userlist,i)))>0 THEN
  4898.         SAY WORD(userlist,i)
  4899.     END
  4900.   END
  4901. IF smenu='MSG' THEN
  4902.   DO
  4903.     SAY 'Searching Message Conferences for'pen3 searcharg||def'...'
  4904.     SAY
  4905.     DO msgdir=1 TO level
  4906.       IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN ITERATE msgdir
  4907.       CALL searchmsgdir()
  4908.       IF msgcom='Q' THEN LEAVE msgdir
  4909.     END
  4910.   END
  4911. IF smenu='FILE' THEN
  4912.   DO
  4913.     SAY pen3'WARNING!'def 'Searching' files.0 '['pen3'F'def']ull descriptions may take'pen3 TRUNC(files.0/(114*cpu)+.05,1) def'minutes!'
  4914.     test=getinput(1 1 ' ['pen3'A'def']lphaList search or ['pen3'F'def']ull descriptions? (Afq) > ')
  4915.     IF test='Q' THEN RETURN
  4916.     IF test~='F' THEN
  4917.       DO
  4918.         SAY
  4919.         SAY pen3'Searching files for'def UPPER(searcharg)
  4920.         CALL fileheader()
  4921.         DO i=1 TO alpha.0
  4922.           IF WORD(alpha.i,4)>level THEN ITERATE i
  4923.           ii=WORD(alpha.i,3)
  4924.           IF POS(UPPER(WORD(files.ii,1)),data.21)>0 THEN ITERATE i
  4925.           tempnum=POS(UPPER(searcharg),UPPER(alpha.i))
  4926.           IF tempnum>0 THEN
  4927.             DO
  4928.               SAY alpha.i
  4929.               IF colorflag=1 THEN
  4930.                 SAY pen3||LEFT(' ',tempnum-1)||lineup||UPPER(searcharg)||def
  4931.             END
  4932.         END
  4933.       END
  4934.     ELSE
  4935.       DO
  4936.         SAY
  4937.         SAY pen3'Searching files for'def UPPER(searcharg)
  4938.         SAY pen3' - To ABORT, press CTRL-E -'def
  4939.         SAY
  4940.         cck=countcheck(bbspath'Numbers/LastFile' 0)
  4941.         nonstop=1
  4942.         DO i=1 TO cck
  4943.           iii=cck+1-i
  4944.           IF files.iii='' THEN ITERATE i
  4945.           farg=WORD(files.iii,1)'/'WORD(files.iii,2)
  4946.           ii=files.iii.0
  4947.           IF WORD(alpha.ii,4)>level THEN ITERATE i
  4948.           IF POS(UPPER(WORD(files.iii,1)),data.21)>0 THEN ITERATE i
  4949.           SAY '1B'x'M' RIGHT(farg,40) LEFT(iii,7)
  4950.           IF textsearch(bbspath'FileNotes/'farg searcharg) THEN
  4951.             DO
  4952.               savei=i
  4953.               CALL readlines(bbspath'FileNotes/'farg 1)
  4954.               CALL seelines(2)
  4955.               i=savei
  4956.               SAY
  4957.               SAY
  4958.             END
  4959.         END
  4960.       END
  4961.   END
  4962. searcharg=''
  4963. nonstop=0
  4964. CALL waiting()
  4965. RETURN
  4966.  
  4967.  
  4968. searchmsgdir:
  4969. msglist=SHOWDIR(msgpath||msgdir)
  4970. IF WORDS(msglist)>0 THEN SAY lineup||RIGHT(msg.msgdir,40)
  4971. DO sri=1 TO WORDS(msglist)
  4972.   messnum=WORD(msglist,sri)%1
  4973.   IF textsearch(msgpath||msgdir'/'messnum searcharg) THEN
  4974.     DO
  4975.       savelast=lastread.msgdir
  4976.       CALL readmsg(0 messnum)
  4977.       lastread.msgdir=savelast
  4978.       IF msgcom='Q' THEN RETURN
  4979.     END
  4980. END
  4981. RETURN
  4982.  
  4983.  
  4984. finddirnum:
  4985. ARG fdirname .
  4986. DO fdir=1 TO 99
  4987.   IF UPPER(dirs.fdir)=UPPER(fdirname) THEN RETURN fdir
  4988. END
  4989. RETURN 100
  4990.  
  4991.  
  4992. writebuffer:
  4993. PARSE ARG bufname .
  4994. CALL DELETE(bufname)
  4995. startnum=lynes.0+1
  4996. OPTIONS PROMPT ''
  4997. SAY pen3'LOCAL logon! Input cannot exceed 250 characters per line!'def
  4998. SAY 'Type 'pen3'/E'def 'or' pen3'/S'def' on a new line to exit and' pen3'DO YOUR OWN WORDWRAP!'def
  4999. DO bufloop=startnum
  5000.   PARSE PULL line
  5001.   IF LEFT(UPPER(STRIP(line)),2)='/E' | LEFT(UPPER(STRIP(line)),2)='/S' THEN
  5002.     LEAVE bufloop
  5003.   lynes.bufloop=line
  5004. END
  5005. lynes.0=bufloop-1
  5006. CALL wrapbuf(startnum)
  5007. CALL DELETE(bufname)     /* these 4 lines make wordwrap more consistent */
  5008. CALL savelines(bufname)
  5009. CALL readlines(bufname 1)
  5010. CALL wrapbuf(startnum)
  5011. RETURN
  5012.  
  5013.  
  5014. wrapbuf:
  5015. ARG startnum .
  5016. CALL cleanline(1)
  5017. SAY pen3'Wordwrapping...'def
  5018. lynes.startnum=TRANSLATE(lynes.startnum,' ','09'x)
  5019. lynes.startnum=COMPRESS(lynes.startnum,'0C'x)  /* no FF */
  5020. DO wi=startnum WHILE wi<=lynes.0
  5021.   wj=wi+1
  5022.   lynes.wj=COMPRESS(lynes.wj,'08'x||'0C'x||'7F'x)
  5023.   tabpos=POS('09'x,lynes.wi)
  5024.   DO WHILE tabpos>0
  5025.     lynes.wi=DELSTR(lynes.wi,tabpos,1)
  5026.     lynes.wi=INSERT('  ',lynes.wi,tabpos-1)
  5027.     tabpos=POS('09'x,lynes.wi)
  5028.   END
  5029.   IF LENGTH(lynes.wi)>75 THEN
  5030.     DO
  5031.       testchar=''
  5032.       IF lynes.wj~='' THEN testchar=LEFT(lynes.wj,1)
  5033.       IF testchar=' ' | testchar='.' | testchar=':' THEN
  5034.         DO
  5035.           DO wjj=lynes.0 TO wi+1 BY -1
  5036.             wk=wjj+1
  5037.             lynes.wk=lynes.wjj
  5038.           END
  5039.           lynes.wj=''
  5040.           lynes.0=lynes.0+1
  5041.         END
  5042.       DO wl=WORDS(lynes.wi) TO 1 BY -1 WHILE LENGTH(lynes.wi)>74
  5043.         IF WORDS(lynes.wi)=1 THEN
  5044.           lynes.wi=LEFT(lynes.wi,74) SUBSTR(lynes.wi,75)
  5045.         lynes.wj=WORD(lynes.wi,wl) lynes.wj
  5046.         lynes.wi=STRIP(DELWORD(lynes.wi,wl,1))
  5047.       END
  5048.     END
  5049. END
  5050. RETURN
  5051.  
  5052.  
  5053. seelines:
  5054. ARG fancy .
  5055. DO i=1 TO lynes.0
  5056.   IF fancy=0 THEN SAY lynes.i||def
  5057.   ELSE
  5058.     DO
  5059.       IF LEFT(lynes.i,2)=': ' & WORDS(lynes.i)=2 THEN ITERATE i
  5060.       ELSE IF LEFT(lynes.i,10)='Directory ' | LEFT(lynes.i,5)='=====' THEN
  5061.         SAY pen3||lynes.i||def
  5062.       ELSE SAY lynes.i
  5063.       IF fancy=2 & colorflag=1 & searcharg~='' THEN
  5064.         DO
  5065.           testpos=POS(UPPER(searcharg),UPPER(lynes.i))
  5066.           IF testpos>0 THEN
  5067.             SAY LEFT(' ',testpos-1)||pen3||lineup||UPPER(searcharg)||def
  5068.         END
  5069.     END
  5070.   IF i//linesperpage=0 THEN
  5071.     IF waiting2() THEN LEAVE i
  5072. END
  5073. nonstop=0
  5074. RETURN
  5075.  
  5076.  
  5077. readlines:
  5078. CALL CLOSE(f)
  5079. PARSE ARG tempname readstart .
  5080. IF ~readopen(tempname) THEN RETURN 1
  5081. IF readstart<2 THEN lynes.=''
  5082. DO ri=readstart
  5083.   line=READLN(f)
  5084.   IF EOF(f) THEN BREAK
  5085.   lynes.ri=line
  5086. END
  5087. lynes.0=ri-1
  5088. CALL CLOSE(f)
  5089. DO ri=lynes.0 TO 0 BY -1 WHILE LENGTH(lynes.ri)=0 | LEFT(UPPER(lynes.ri),2)='/E' | LEFT(UPPER(lynes.ri),2)='/S'
  5090. END
  5091. lynes.0=ri
  5092. RETURN 0
  5093.  
  5094.  
  5095. savelines:
  5096. PARSE ARG tempname .
  5097. IF EXISTS(tempname) & edtype='MAIL' THEN
  5098.   DO
  5099.     ok=OPEN(f,tempname,'A')
  5100.     IF ok~=0 THEN CALL WRITELN(f,INSERT('','',1,74,'^'))
  5101.   END
  5102. ELSE ok=OPEN(f,tempname,'W')
  5103. IF ok=0 THEN
  5104.   DO
  5105.     line='***' tempname 'failed to open for saving!'
  5106.     SAY line
  5107.     RETURN 1
  5108.   END
  5109. DO wi=1 TO lynes.0
  5110.   CALL WRITELN(f,lynes.wi)
  5111. END
  5112. CALL CLOSE(f)
  5113. RETURN 0
  5114.  
  5115.  
  5116. loaduserlist:
  5117. userlist=SHOWDIR(bbspath'Users')
  5118. ulynes.=''
  5119. IF ~EXISTS(bbspath'Lists/USERS') THEN CALL sortuserlist()
  5120. ELSE IF readopen(bbspath'Lists/USERS') THEN
  5121.   DO
  5122.     SAY 'Loading Userlist...'
  5123.     DO lui=1
  5124.       line=READLN(f)
  5125.       IF EOF(f) THEN BREAK
  5126.       ulynes.lui=line
  5127.     END
  5128.     ulynes.0=lui-1
  5129.     CALL CLOSE(f)
  5130.   END
  5131. RETURN
  5132.  
  5133.  
  5134. saveuserlist:
  5135. SIGNAL OFF BREAK_E
  5136. IF writeopen(bbspath'Lists/USERS') THEN
  5137.   DO
  5138.     DO i=1 TO ulynes.0
  5139.       CALL WRITELN(f,ulynes.i)
  5140.     END
  5141.     CALL CLOSE(f)
  5142.   END
  5143. RETURN
  5144.  
  5145.  
  5146. sortuserlist:
  5147. SAY 'Rebuilding Userlist...'
  5148. userlist=SHOWDIR(bbspath'Users')
  5149. user.=''
  5150. users=WORDS(userlist)
  5151. user.0=users
  5152. DO uli=1 TO users
  5153.   user.uli=WORD(userlist,uli)
  5154.   uscore=LASTPOS('_',user.uli)
  5155.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'@'LEFT(user.uli,uscore-1)
  5156. END
  5157. CALL QSORT(1,users,user)
  5158. DO uli=1 TO users
  5159.   uscore=POS('@',user.uli)
  5160.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'_'LEFT(user.uli,uscore-1)
  5161. END
  5162. ulynes.=''
  5163. ulynes.0=user.0%3
  5164. IF (user.0//3)>0 THEN ulynes.0=ulynes.0+1
  5165. DO i=1 TO ulynes.0
  5166.   ulynes.i=LEFT(user.i,25)
  5167.   DO j=1 TO 2
  5168.     k=i+j*ulynes.0
  5169.     IF k<=users THEN ulynes.i=ulynes.i' 'LEFT(user.k,25)
  5170.   END
  5171. END
  5172. CALL saveuserlist()
  5173. RETURN
  5174.  
  5175.  
  5176. showuserlist:
  5177. IF data.5='' THEN line='Here are the EMail names of your fellow users.'
  5178. ELSE line='   'WORDS(userlist) 'users. Use these names to address messages.'
  5179. SAY pen3||line||def
  5180. DO uli=1 TO ulynes.0
  5181.   SAY ulynes.uli
  5182.   IF uli//linesperpage=0 & uli<ulynes.0 THEN
  5183.     IF waiting2()=1 THEN RETURN
  5184. END
  5185. IF data.5~='' THEN CALL waiting()
  5186. RETURN
  5187.  
  5188.  
  5189. msgcount:
  5190. ARG countdir .
  5191. lastmess=0
  5192. totmsgs=0
  5193. unred=0
  5194. IF ~EXISTS(msgpath||countdir) THEN RETURN
  5195. IF STATEF(msgpath||countdir)=msg.countdir.1 THEN totmsgs=msg.countdir.0
  5196. ELSE
  5197.   DO
  5198.     totmsgs=WORDS(SHOWDIR(msgpath||countdir))
  5199.     msg.countdir.0=totmsgs
  5200.     msg.countdir.1=STATEF(msgpath||countdir)
  5201.   END
  5202. IF countdir>level | FIND(data.21,i)>0 THEN RETURN
  5203. lastread.countdir=WORD(data.22,countdir)
  5204. IF ~DATATYPE(lastread.countdir,'W') THEN lastread.countdir=0
  5205. lastmess=countcheck(bbspath'Numbers/LastMessage'countdir 0)
  5206. IF lastread.countdir<0 THEN RETURN
  5207. firstmess=countcheck(bbspath'Numbers/FirstMessage'countdir 0)
  5208. IF lastread.countdir<firstmess THEN lastread.countdir=firstmess-1
  5209. IF lastmess>0 THEN
  5210.   IF lastread.countdir>=0 THEN
  5211.     DO
  5212.       IF lastread.countdir<(firstmess-1) THEN lastread.countdir=firstmess-1
  5213.       unred=lastmess-lastread.countdir
  5214.       IF unred>totmsgs THEN unred=totmsgs
  5215.       cline=RIGHT(unred,6) 'unread of' RIGHT(lastmess,6)
  5216.       cline=cline 'messages in the 'CENTER(msg.countdir,20)' conference.'
  5217.       IF unred>0 | ~logonflag THEN SAY pen6||cline||def
  5218.     END
  5219. RETURN
  5220.  
  5221.  
  5222. counts:
  5223. temp=''
  5224. DO i=1 TO 4
  5225.   temp=temp||CENTER(copyright.i,75)||'0A'x
  5226. END
  5227. CALL SETCLIP('BBS_copyright',temp)
  5228. IF emailonline<0 THEN CALL countmail()
  5229. CALL bbsSTATS(name colorflag 0 emailonline grand grand2 files.0)
  5230. SAY
  5231. CALL waiting2()
  5232. IF waitchar='Q' THEN RETURN
  5233. CALL showmarked()
  5234. CALL logonstats()
  5235. nonstop=0
  5236. CALL waiting()
  5237. RETURN
  5238.  
  5239.  
  5240. countmail:
  5241. SAY '   Counting online email...'
  5242. emailonline=0
  5243. DO ti=1 TO WORDS(userlist)
  5244.   emailonline=emailonline+WORDS(SHOWDIR(bbspath'Email/'WORD(userlist,ti)))
  5245. END
  5246. RETURN
  5247.  
  5248.  
  5249. hourly:
  5250. IF level=99 & nonstop~=1 THEN
  5251.   DO
  5252.     IF getinput(1 1 'Zero The Hourly Averages? (Ny) > ')='Y' THEN
  5253.       ADDRESS COMMAND 'C:Delete >*' bbspath'Numbers/Hourly/#?'
  5254.     CALL cleanline(1)
  5255.   END
  5256. CALL ShowHourly.rexx(name linesperpage colorflag nonstop)
  5257. RETURN
  5258.  
  5259.  
  5260. logonstats:
  5261. IF level=0 THEN RETURN
  5262. SAY bak2||name||def 'Last on' DATE('W',lastondate,'I') DATE(,lastondate,'I') lastontime
  5263. tempnum=countcheck(bbspath'Numbers/LastFile' 0)-lastbrowse
  5264. IF tempnum>files.0 THEN tempnum=files.0
  5265. line='of' RIGHT(countcheck(bbspath'Numbers/LastFile' 0),6) 'public files uploaded.'
  5266. IF tempnum>0 THEN SAY RIGHT(tempnum,6) '   new of' RIGHT(files.0,6) 'files online    'line
  5267. ELSE SAY '       No new' line
  5268. totmsg=0
  5269. grand=0
  5270. grand2=0
  5271. DO i=1 TO 99
  5272.   IF msg.i='' THEN ITERATE i
  5273.   CALL msgcount(i)
  5274.   totmsg=totmsg+unred
  5275.   grand=grand+totmsgs
  5276.   grand2=grand2+lastmess
  5277. END
  5278. line=RIGHT(grand2,6) 'public messages written'
  5279. IF totmsg>0 THEN
  5280.   SAY RIGHT(totmsg,6) '   new of' line',' grand 'messages online.'
  5281. ELSE SAY '       No new of' line'.'
  5282. RETURN
  5283.  
  5284.  
  5285. readopen:
  5286. PARSE ARG fname
  5287. ok=OPEN(f,fname,'R')
  5288. IF ok~=0 THEN RETURN 1
  5289. line=fname 'failed to open for reading!'
  5290. SAY line
  5291. RETURN 0
  5292.  
  5293.  
  5294. writeopen:
  5295. PARSE ARG fname
  5296. CALL CLOSE(f)
  5297. ok=OPEN(f,fname,'W')
  5298. IF ok~=0 THEN RETURN 1
  5299. line=fname 'failed to open for writing!'
  5300. SAY line
  5301. RETURN 0
  5302.  
  5303.  
  5304. set_grand:
  5305. SAY 'Setting up public message conferences...'
  5306. grand=0
  5307. DO i=1 TO 99
  5308.   IF msg.i='' THEN ITERATE i
  5309.   msg.i.0=WORDS(SHOWDIR(msgpath||i,'F'))
  5310.   msg.i.1=STATEF(msgpath||i)
  5311.   grand=grand+msg.i.0
  5312. END
  5313. RETURN
  5314.  
  5315.  
  5316. SYNTAX:
  5317. FAILURE:
  5318. lin.1=pen7||ERRORTEXT(RC)||def
  5319. lin.2=SIGL-1     SOURCELINE(SIGL-1)
  5320. lin.3=SIGL pen7||SOURCELINE(SIGL)||def
  5321. lin.4=SIGL+1     SOURCELINE(SIGL+1)
  5322. DO er=1 TO 4
  5323.   SAY lin.er
  5324. END
  5325. IF newpassword='' THEN SIGNAL DONE2  /* no user logged on, quit quietly */
  5326. CALL CLOSE(f)
  5327. IF level>sysoplevel THEN
  5328.   DO
  5329.     junk=getinput(1 1 'ReStart: (Ny) > ')
  5330.     IF junk~='Y' THEN SIGNAL LOGOUT
  5331.   END
  5332. string=''
  5333. waitchar=''
  5334. IF data.1~='' & data.5~='' & data.20~='' THEN CALL savedata(0)
  5335. SIGNAL RESTART
  5336.  
  5337.  
  5338. BREAK_E:
  5339. CALL CLOSE(f)
  5340. SAY pen3'*** CTRL-E BREAK ***'def
  5341. waitchar=''
  5342. string=''
  5343. nonstop=0
  5344. rnonstop=0
  5345. brostop=0
  5346. i=999999
  5347. wi=999999
  5348. ni=0
  5349. RETURN 0
  5350.  
  5351.  
  5352. BREAK_C:
  5353. CALL CLOSE(f)
  5354.  
  5355. LOGOUT:
  5356. LOGOUT2:
  5357. secs=TIME('E')
  5358. mins=secs%60
  5359. secs=TRUNC(secs//60)
  5360. IF secs<10 THEN secs='0'secs
  5361. SAY
  5362. SAY 'Public messages now online: 'RIGHT(comma(grand),9)
  5363. SAY 'Public    files now online: 'RIGHT(comma(files.0),9)
  5364. SAY
  5365. SAY 'Time used this call:' mins':'secs
  5366. SAY
  5367. arg=bbspath'BBS_TEXT/GOODBYE'
  5368. IF EXISTS(arg) THEN
  5369.   DO
  5370.     CALL DELAY(14)
  5371.     CALL readlines(arg 1)
  5372.     nonstop=1
  5373.     CALL seelines(0)
  5374.     nonstop=0
  5375.   END
  5376. SAY
  5377. IF bbsprefs.2 THEN CALL doGrin()
  5378. SAY 
  5379. CALL bbsLOGOFF.baud(name level 0)
  5380.  
  5381. OUT:
  5382. data.18=winnings
  5383.  
  5384. OUT2:
  5385.  
  5386. DONE:
  5387.  
  5388. DONE2:
  5389. IF newfilesflag=1 THEN
  5390.   DO
  5391.     newfilesdate=DATE('S') TIME()
  5392.     lastbrowse=countcheck(bbspath'Numbers/LastFile' 0)
  5393.   END
  5394. IF clear_marked=1 THEN data.24=''
  5395. CALL saveData(0)
  5396. IF EXISTS(bbspath'EmailFiles/'name'/QUICKIN.lha') THEN
  5397.   ADDRESS AREXX bbsQUICKIN.rexx name level sysoplevel bbsprefs.6
  5398. IF sortuserflag=1 THEN
  5399.   DO
  5400.     CALL sortuserlist()
  5401.     IF SHOW('P','BBBBS') THEN
  5402.       DO
  5403.         CALL SETCLIP('BBS_mainusers')
  5404.         CALL SETCLIP('BBS_localusers',1)
  5405.       END
  5406.     sortuserflag=0
  5407.   END
  5408. IF sortalphaflag>0 | savefileflag>0 THEN
  5409.   DO
  5410.     IF savefileflag>0 THEN CALL savefilelist2()
  5411.     ELSE CALL savealphalist()
  5412.     IF SHOW('P','BBBBS') THEN CALL SETCLIP('BBS_localfiles',2)
  5413.   END
  5414. IF getinput(1 1 'Reset for next local user? (nY) > ')='N' THEN EXIT
  5415. clear_marked=0
  5416. data.=''
  5417. SIGNAL BIG_LOOP
  5418.  
  5419.  
  5420. checkclips:
  5421. IF GETCLIP('BBS_mainusers')~='' THEN
  5422.   DO
  5423.     CALL loaduserlist()
  5424.     CALL SETCLIP('BBS_mainusers')
  5425.   END
  5426. IF GETCLIP('BBS_mainfiles')~='' & GETCLIP('BBS_maint')='' THEN
  5427.   DO
  5428.     CALL SETCLIP('BBS_mainfiles')
  5429.     CALL loadfiles()
  5430.     CALL loadalpha()
  5431.   END
  5432. RETURN
  5433.  
  5434. /* bbsLOCAL.rexx */
  5435.  
  5436.  
  5437. /*  Userfile Data definitions */
  5438.  
  5439.  1 name
  5440.  2 address
  5441.  3 city state country zip
  5442.  4 telephone
  5443.  5 password
  5444.  6 protocol
  5445.  7 lines per page
  5446.  8 Preferences: MENUS COLOR STREET PHONE etc. On list=YES, ON or PUBLIC.
  5447.  9 Computer model
  5448. 10 interests        ! SYSOP edit only below this line !
  5449. 11 nn minutes n more times today  (typically 60 mins 3 times/day).
  5450. 12 first date on.  timestamp  Birthday: birthday
  5451. 13 last  date on BBS in 'S' form for rexx DATE().
  5452. 14 uploaded files bytes lastdate
  5453. 15 downloaded files bytes lastdate
  5454. 16 lastfilebrowsed lastfilelistdate lastfilelisttime
  5455. 17 ul:dl_ratio  total_email_written  last_email_read_(sysop only)
  5456. 18 winnings
  5457. 19 total time on this BBS in hours minutes calls
  5458. 20 level
  5459. 21 exclude dirs by name (conferences by number), separated by spaces.
  5460. 22 oldest messages read
  5461. 23 total msgs written per conference
  5462. 24 Marked message list  msgdirnum/msgnum
  5463. 25 filenumbers to download (temporary)
  5464. 26 QUICK exclude list
  5465.  
  5466. /* end data defines */
  5467.